Convert all sample tests to @IntegrationTest where appropriate
Makes them a lot more readable IMO, and also enables @Autowiring from the context into the test case (sweeet). I added @DirtiesContext to all of them as well to be on the safe side, but possbly that can be optimized in some way as well.
This commit is contained in:
@@ -18,8 +18,7 @@ package sample.simple;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.SpringApplicationContextLoader;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
@@ -28,7 +27,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = SampleSimpleApplication.class, loader = SpringApplicationContextLoader.class)
|
||||
@SpringApplicationConfiguration(classes = SampleSimpleApplication.class)
|
||||
public class SpringTestSampleSimpleApplicationTests {
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user