mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:25:50 +00:00
Move util class to test code
This commit is contained in:
parent
e38a9feebe
commit
095b1a35d9
2 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
* TestContext Framework: </p> <ul> <li><strong>Spring IoC container caching</strong> which spares us unnecessary set up
|
* TestContext Framework: </p> <ul> <li><strong>Spring IoC container caching</strong> which spares us unnecessary set up
|
||||||
* time between test execution.</li> <li><strong>Dependency Injection</strong> of test fixture instances, meaning that
|
* time between test execution.</li> <li><strong>Dependency Injection</strong> of test fixture instances, meaning that
|
||||||
* we don't need to perform application context lookups. See the use of {@link Autowired @Autowired} on the <code>{@link
|
* we don't need to perform application context lookups. See the use of {@link Autowired @Autowired} on the <code>{@link
|
||||||
* ClinicServiceSpringDataJpaTests#clinicService clinicService}</code> instance variable, which uses autowiring <em>by
|
* ClinicServiceTests#clinicService clinicService}</code> instance variable, which uses autowiring <em>by
|
||||||
* type</em>. <li><strong>Transaction management</strong>, meaning each test method is executed in its own transaction,
|
* type</em>. <li><strong>Transaction management</strong>, meaning each test method is executed in its own transaction,
|
||||||
* which is automatically rolled back by default. Thus, even if tests insert or otherwise change database state, there
|
* which is automatically rolled back by default. Thus, even if tests insert or otherwise change database state, there
|
||||||
* is no need for a teardown or cleanup script. <li> An {@link org.springframework.context.ApplicationContext
|
* is no need for a teardown or cleanup script. <li> An {@link org.springframework.context.ApplicationContext
|
||||||
|
@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@DataJpaTest(includeFilters = @ComponentScan.Filter(Service.class))
|
@DataJpaTest(includeFilters = @ComponentScan.Filter(Service.class))
|
||||||
public class ClinicServiceSpringDataJpaTests {
|
public class ClinicServiceTests {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ClinicService clinicService;
|
protected ClinicService clinicService;
|
Loading…
Reference in a new issue