michaelin007 2023-12-21 09:48:02 +00:00
parent e8b2ea9a92
commit b689e22bcf
4 changed files with 13 additions and 15 deletions

View File

@ -18,10 +18,6 @@ import static org.junit.Assert.assertNotNull;
@SpringJUnitConfig(SpringJUnitConfigIntegrationTest.Config.class)
public class SpringJUnitConfigIntegrationTest {
@Configuration
static class Config {
}
@Autowired
private ApplicationContext applicationContext;
@ -30,4 +26,8 @@ public class SpringJUnitConfigIntegrationTest {
assertNotNull(applicationContext);
}
@Configuration
static class Config {
}
}

View File

@ -1,13 +1,11 @@
package com.baeldung.springjunitconfiguration;
import java.util.List;
import org.junit.jupiter.params.ParameterizedTest;
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.support.AnnotationConfigContextLoader;
import java.util.List;
@SpringJUnitConfig(classes = TestConfig.class, loader = AnnotationConfigContextLoader.class)
public class SpringJUnitConfigurationParameterizedTest {

View File

@ -19,10 +19,6 @@ import static org.junit.Assert.assertNotNull;
@SpringJUnitWebConfig(SpringJUnitWebConfigIntegrationTest.Config.class)
public class SpringJUnitWebConfigIntegrationTest {
@Configuration
static class Config {
}
@Autowired
private WebApplicationContext webAppContext;
@ -31,4 +27,8 @@ public class SpringJUnitWebConfigIntegrationTest {
assertNotNull(webAppContext);
}
@Configuration
static class Config {
}
}

View File

@ -2,7 +2,7 @@ package com.baeldung.springjunitconfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@Configuration
public class TestConfig {