changes related to spring-boot-modules/spring-boot-testing boot 2.4.0 upgrade
This commit is contained in:
parent
1a0655a189
commit
1ed7c56596
|
@ -51,6 +51,17 @@
|
|||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Embedded Redis Server -->
|
||||
<dependency>
|
||||
|
|
|
@ -7,13 +7,13 @@ import org.junit.jupiter.api.Test;
|
|||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
|
||||
import org.springframework.boot.test.context.ConfigDataApplicationContextInitializer;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@ContextConfiguration(initializers = ConfigFileApplicationContextInitializer.class)
|
||||
@ContextConfiguration(initializers = ConfigDataApplicationContextInitializer.class)
|
||||
@EnableConfigurationProperties(value = ServerConfig.class)
|
||||
@ActiveProfiles("test")
|
||||
public class BindingYMLPropertiesUnitTest {
|
||||
|
|
|
@ -4,7 +4,7 @@ import org.junit.jupiter.api.Test;
|
|||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
|
||||
import org.springframework.boot.test.context.ConfigDataApplicationContextInitializer;
|
||||
import org.springframework.boot.test.mock.mockito.SpyBean;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
|
@ -19,7 +19,7 @@ import static org.mockito.Mockito.verify;
|
|||
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@ContextConfiguration(classes = { ApplicationCommandLineRunnerApp.class },
|
||||
initializers = ConfigFileApplicationContextInitializer.class)
|
||||
initializers = ConfigDataApplicationContextInitializer.class)
|
||||
public class LoadSpringContextIntegrationTest {
|
||||
@SpyBean
|
||||
TaskService taskService;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
spring:
|
||||
profiles: test
|
||||
config:
|
||||
activate:
|
||||
on-profile: test
|
||||
server:
|
||||
address:
|
||||
ip: 192.168.0.4
|
||||
|
@ -7,7 +9,9 @@ server:
|
|||
imgs: /etc/test/imgs
|
||||
---
|
||||
spring:
|
||||
profiles: dev
|
||||
config:
|
||||
activate:
|
||||
on-profile: dev
|
||||
server:
|
||||
address:
|
||||
ip: 192.168.0.5
|
||||
|
|
Loading…
Reference in New Issue