diff --git a/smoke-test/spring-boot-smoke-test-actuator-custom-security/build.gradle b/smoke-test/spring-boot-smoke-test-actuator-custom-security/build.gradle index 6cae3245b3a..36c1ddd6c8c 100644 --- a/smoke-test/spring-boot-smoke-test-actuator-custom-security/build.gradle +++ b/smoke-test/spring-boot-smoke-test-actuator-custom-security/build.gradle @@ -30,4 +30,8 @@ dependencies { testImplementation(project(":starter:spring-boot-starter-test")) testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5") -} \ No newline at end of file +} + +tasks.named("compileTestJava") { + options.nullability.checking = "tests" +} diff --git a/smoke-test/spring-boot-smoke-test-actuator-custom-security/src/test/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplicationTests.java b/smoke-test/spring-boot-smoke-test-actuator-custom-security/src/test/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplicationTests.java index b40505f56d4..e2e9becc893 100644 --- a/smoke-test/spring-boot-smoke-test-actuator-custom-security/src/test/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplicationTests.java +++ b/smoke-test/spring-boot-smoke-test-actuator-custom-security/src/test/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplicationTests.java @@ -52,6 +52,7 @@ class SampleActuatorCustomSecurityApplicationTests extends AbstractSampleActuato ResponseEntity entity = restTemplate().getForEntity(getPath() + "/foo", Map.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR); Map body = entity.getBody(); + assertThat(body).isNotNull(); assertThat((String) body.get("message")).contains("Expected exception in controller"); }