Skip to content

Commit e185793

Browse files
committed
Update test to correct name of metric for request that returns a 401
The request is being made to '/' and, while the application does have a mapping for '/', that mapping is not looked for before Spring Security's filter rejects the request with a 401. This means that the request is considered to be unmapped and this is reflected in the metric's name. See #1331 and #1333
1 parent 1259057 commit e185793

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/UnsecureManagementSampleActuatorApplicationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testMetrics() throws Exception {
7979
assertEquals(HttpStatus.OK, entity.getStatusCode());
8080
@SuppressWarnings("unchecked")
8181
Map<String, Object> body = entity.getBody();
82-
assertTrue("Wrong body: " + body, body.containsKey("counter.status.401.root"));
82+
assertTrue("Wrong body: " + body, body.containsKey("counter.status.401.unmapped"));
8383
}
8484

8585
}

0 commit comments

Comments
 (0)