This commit is contained in:
parent
e8b2ea9a92
commit
b689e22bcf
|
@ -18,10 +18,6 @@ import static org.junit.Assert.assertNotNull;
|
||||||
@SpringJUnitConfig(SpringJUnitConfigIntegrationTest.Config.class)
|
@SpringJUnitConfig(SpringJUnitConfigIntegrationTest.Config.class)
|
||||||
public class SpringJUnitConfigIntegrationTest {
|
public class SpringJUnitConfigIntegrationTest {
|
||||||
|
|
||||||
@Configuration
|
|
||||||
static class Config {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationContext applicationContext;
|
private ApplicationContext applicationContext;
|
||||||
|
|
||||||
|
@ -30,4 +26,8 @@ public class SpringJUnitConfigIntegrationTest {
|
||||||
assertNotNull(applicationContext);
|
assertNotNull(applicationContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
static class Config {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
package com.baeldung.springjunitconfiguration;
|
package com.baeldung.springjunitconfiguration;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||||
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@SpringJUnitConfig(classes = TestConfig.class , loader = AnnotationConfigContextLoader.class)
|
@SpringJUnitConfig(classes = TestConfig.class, loader = AnnotationConfigContextLoader.class)
|
||||||
public class SpringJUnitConfigurationParameterizedTest {
|
public class SpringJUnitConfigurationParameterizedTest {
|
||||||
|
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
|
|
|
@ -19,10 +19,6 @@ import static org.junit.Assert.assertNotNull;
|
||||||
@SpringJUnitWebConfig(SpringJUnitWebConfigIntegrationTest.Config.class)
|
@SpringJUnitWebConfig(SpringJUnitWebConfigIntegrationTest.Config.class)
|
||||||
public class SpringJUnitWebConfigIntegrationTest {
|
public class SpringJUnitWebConfigIntegrationTest {
|
||||||
|
|
||||||
@Configuration
|
|
||||||
static class Config {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WebApplicationContext webAppContext;
|
private WebApplicationContext webAppContext;
|
||||||
|
|
||||||
|
@ -31,4 +27,8 @@ public class SpringJUnitWebConfigIntegrationTest {
|
||||||
assertNotNull(webAppContext);
|
assertNotNull(webAppContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
static class Config {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.baeldung.springjunitconfiguration;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class TestConfig {
|
public class TestConfig {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue