It started recently, but I'm not sure what has changed to trigger it.
- When I run all the tests from IntelliJ, everything is fine. In addition, the gradle build is beautiful.
- When I run one unit test, everything is fine.
- When I run one integration test on the Internet, it fails because the configuration class has all the null properties.
The configuration class looks like (Kotlin):
@Component @ConfigurationProperties(prefix = "api") public open class ApiConfigImpl : ApiConfig {
The test is as follows:
@RunWith(SpringJUnit4ClassRunner::class) @ContextConfiguration(classes = arrayOf(ApplicationAssembly::class), loader = SpringApplicationContextLoader::class) @WebIntegrationTest open class CandidateProfileControllerTest { @Inject lateinit var profileRepo: CandidateProfileRepository //etc a few more deps used to setup test data @Test open fun getById() { val greg = CandidateProfile("123", "12312", "Greg", "Jones", dateOfBirth = Date(), gender = Gender.MALE, biography = "ABC", maxMatchableAge = null, maxMatchableDistance = null) profileRepo.save(greg) val auth = given().header("content-type", "application/json") .body(testCredentials) .post("/authorization/social").peek().asString() val accessToken: String = from(auth).get("accessToken") given().header("Access-Token", accessToken). header("API-Key", testAPIKey()). get("/profile/${greg.id}"). peek().then(). body("stageName", notNullValue()) }
I am not sure what information I can add. Based on limited information:
- Is this a known issue with a known solution?
java spring spring-boot intellij-idea kotlin
Jasper blues
source share