in component-test/src/main/java/org/apache/fineract/cn/anubis/TestSystemToken.java [41:52]
public void shouldNotBeAbleToContactSpringEndpointWithGuestTokenWhenNotSoConfigured() throws Exception {
try (final AutoUserContext ignored = new AutoGuest()) {
metricsFeignClient.getMetrics();
Assert.fail("Should not be able to get metrics with guest token unless system is so configured.");
}
catch (final NotFoundException ignore) { }
try (final AutoUserContext ignored = tenantApplicationSecurityEnvironment.createAutoSeshatContext()) {
final Metrics metrics = metricsFeignClient.getMetrics();
Assert.assertTrue(metrics.getThreads() > 0);
}
}