made junit5 default test generation framework (#1320)

fixes #1249
This commit is contained in:
Marcin Grzejszczak
2020-02-07 13:43:30 +01:00
committed by GitHub
parent a48c491bfd
commit eeb2d87c14
72 changed files with 487 additions and 252 deletions

View File

@@ -45,7 +45,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation 'org.springframework.cloud:spring-cloud-starter-contract-stub-runner'
// tag::dependencies[]
testImplementation 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
@@ -73,6 +73,7 @@ contracts {
baseClassMapping('.*standalone.*', 'com.example.fraud.FraudBaseWithStandaloneSetup')
baseClassMapping('.*webapp.*', 'com.example.fraud.FraudBaseWithWebAppSetup')
}
testFramework("JUNIT")
}
generateClientStubs.enabled = false

View File

@@ -148,6 +148,7 @@
</baseClassFQN>
</baseClassMapping>
</baseClassMappings>
<testFramework>JUNIT</testFramework>
</configuration>
</plugin>
<!-- end::plugin[] -->

View File

@@ -7,6 +7,7 @@ import org.junit.Rule;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.restdocs.JUnitRestDocumentation;

View File

@@ -24,6 +24,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.AutoConfigureJsonTesters;
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
@@ -31,6 +32,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.json.JacksonTester;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;

View File

@@ -16,6 +16,7 @@
package com.example.fraud;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -25,6 +26,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;