minor import cleanup
This commit is contained in:
parent
663a2f7593
commit
9241c94f0a
|
@ -9,28 +9,22 @@ import static junit.framework.TestCase.assertTrue;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.baeldung.config.PersistenceConfiguration;
|
||||
import com.baeldung.config.PersistenceProductConfiguration;
|
||||
import com.baeldung.config.PersistenceUserConfiguration;
|
||||
import com.baeldung.dao.repositories.ItemTypeRepository;
|
||||
import com.baeldung.dao.repositories.LocationRepository;
|
||||
import com.baeldung.dao.repositories.ReadOnlyLocationRepository;
|
||||
import com.baeldung.dao.repositories.StoreRepository;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.baeldung.config.PersistenceConfiguration;
|
||||
import com.baeldung.config.PersistenceProductConfiguration;
|
||||
import com.baeldung.config.PersistenceUserConfiguration;
|
||||
import com.baeldung.domain.Item;
|
||||
import com.baeldung.domain.ItemType;
|
||||
import com.baeldung.domain.Location;
|
||||
import com.baeldung.domain.Store;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@DataJpaTest(excludeAutoConfiguration = {PersistenceConfiguration.class, PersistenceUserConfiguration.class, PersistenceProductConfiguration.class})
|
||||
@DataJpaTest(excludeAutoConfiguration = { PersistenceConfiguration.class, PersistenceUserConfiguration.class, PersistenceProductConfiguration.class })
|
||||
public class JpaRepositoriesIntegrationTest {
|
||||
@Autowired
|
||||
private LocationRepository locationRepository;
|
||||
|
|
|
@ -1,31 +1,33 @@
|
|||
package com.baeldung.services;
|
||||
|
||||
import com.baeldung.config.PersistenceProductConfiguration;
|
||||
import com.baeldung.config.PersistenceUserConfiguration;
|
||||
import com.baeldung.dao.repositories.user.PossessionRepository;
|
||||
import com.baeldung.dao.repositories.product.ProductRepository;
|
||||
import com.baeldung.dao.repositories.user.UserRepository;
|
||||
import com.baeldung.domain.user.Possession;
|
||||
import com.baeldung.domain.product.Product;
|
||||
import com.baeldung.domain.user.User;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import com.baeldung.config.PersistenceProductConfiguration;
|
||||
import com.baeldung.config.PersistenceUserConfiguration;
|
||||
import com.baeldung.dao.repositories.product.ProductRepository;
|
||||
import com.baeldung.dao.repositories.user.PossessionRepository;
|
||||
import com.baeldung.dao.repositories.user.UserRepository;
|
||||
import com.baeldung.domain.product.Product;
|
||||
import com.baeldung.domain.user.Possession;
|
||||
import com.baeldung.domain.user.User;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration(classes = {PersistenceUserConfiguration.class, PersistenceProductConfiguration.class})
|
||||
@ContextConfiguration(classes = { PersistenceUserConfiguration.class, PersistenceProductConfiguration.class })
|
||||
@EnableTransactionManagement
|
||||
@DirtiesContext
|
||||
public class JpaMultipleDBIntegrationTest {
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
package com.baeldung.services;
|
||||
|
||||
import com.baeldung.config.PersistenceConfiguration;
|
||||
import com.baeldung.domain.Bar;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -10,15 +18,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.security.test.context.support.WithMockUser;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import com.baeldung.config.PersistenceConfiguration;
|
||||
import com.baeldung.domain.Bar;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration(classes = { PersistenceConfiguration.class }, loader = AnnotationConfigContextLoader.class)
|
||||
|
|
Loading…
Reference in New Issue