fix junit test case

This commit is contained in:
amit.pandey 2020-04-12 01:23:02 +05:30
parent 2478c10c84
commit b43d6e9bc8
2 changed files with 6 additions and 2 deletions

View File

@ -5,9 +5,7 @@ import java.util.Optional;
import org.springframework.data.domain.AuditorAware;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
@Component("auditorProvider")
public class AuditorAwareImpl implements AuditorAware<String> {
@Override

View File

@ -23,6 +23,7 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.baeldung.hibernate.audit.AuditorAwareImpl;
import com.baeldung.persistence.dao.IBarAuditableDao;
import com.baeldung.persistence.dao.IBarDao;
import com.baeldung.persistence.dao.IFooAuditableDao;
@ -58,6 +59,11 @@ public class PersistenceConfig {
super();
}
@Bean("auditorProvider")
public AuditorAwareImpl auditorAwareImpl() {
return new AuditorAwareImpl();
}
@Bean
public LocalSessionFactoryBean sessionFactory() {
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();