[JAVA-8355] Move article code to spring-testing-2 module
This commit is contained in:
parent
be86acb87f
commit
805500140f
|
@ -3,3 +3,4 @@
|
|||
- [Guide to @DynamicPropertySource in Spring](https://www.baeldung.com/spring-dynamicpropertysource)
|
||||
- [Concurrent Test Execution in Spring 5](https://www.baeldung.com/spring-5-concurrent-tests)
|
||||
- [Spring 5 Testing with @EnabledIf Annotation](https://www.baeldung.com/spring-5-enabledIf)
|
||||
- [The Spring TestExecutionListener](https://www.baeldung.com/spring-testexecutionlistener)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.baeldung.testexecutionlisteners;
|
||||
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -9,9 +7,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration(classes = AdditionService.class)
|
||||
public class AdditionServiceUnitTest {
|
||||
|
||||
@Autowired
|
||||
private AdditionService additionService;
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
package com.baeldung.testexecutionlisteners;
|
||||
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -11,11 +9,14 @@ import org.springframework.test.context.TestExecutionListeners;
|
|||
import org.springframework.test.context.TestExecutionListeners.MergeMode;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@TestExecutionListeners(value = { CustomTestExecutionListener.class },
|
||||
mergeMode = MergeMode.MERGE_WITH_DEFAULTS)
|
||||
@ContextConfiguration(classes = AdditionService.class)
|
||||
public class TestExecutionListenersWithMergeModeUnitTest {
|
||||
|
||||
@Autowired
|
||||
private AdditionService additionService;
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
package com.baeldung.testexecutionlisteners;
|
||||
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -11,11 +9,14 @@ import org.springframework.test.context.TestExecutionListeners;
|
|||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@TestExecutionListeners(value = {CustomTestExecutionListener.class,
|
||||
DependencyInjectionTestExecutionListener.class})
|
||||
@ContextConfiguration(classes = AdditionService.class)
|
||||
public class TestExecutionListenersWithoutMergeModeUnitTest {
|
||||
|
||||
@Autowired
|
||||
private AdditionService additionService;
|
||||
|
|
@ -7,4 +7,3 @@
|
|||
- [Using SpringJUnit4ClassRunner with Parameterized](https://www.baeldung.com/springjunit4classrunner-parameterized)
|
||||
- [Override Properties in Spring’s Tests](https://www.baeldung.com/spring-tests-override-properties)
|
||||
- [A Quick Guide to @DirtiesContext](https://www.baeldung.com/spring-dirtiescontext)
|
||||
- [The Spring TestExecutionListener](https://www.baeldung.com/spring-testexecutionlistener)
|
||||
|
|
Loading…
Reference in New Issue