Browse Source

Add nullability annotations to tests in smoke-test/spring-boot-smoke-test-actuator-custom-security

See gh-47263
pull/47665/head
Moritz Halbritter 2 months ago
parent
commit
1b27de688a
  1. 4
      smoke-test/spring-boot-smoke-test-actuator-custom-security/build.gradle
  2. 1
      smoke-test/spring-boot-smoke-test-actuator-custom-security/src/test/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplicationTests.java

4
smoke-test/spring-boot-smoke-test-actuator-custom-security/build.gradle

@ -31,3 +31,7 @@ dependencies { @@ -31,3 +31,7 @@ dependencies {
testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5")
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}

1
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 @@ -52,6 +52,7 @@ class SampleActuatorCustomSecurityApplicationTests extends AbstractSampleActuato
ResponseEntity<Map> entity = restTemplate().getForEntity(getPath() + "/foo", Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR);
Map<String, Object> body = entity.getBody();
assertThat(body).isNotNull();
assertThat((String) body.get("message")).contains("Expected exception in controller");
}

Loading…
Cancel
Save