use of ch.qos.logback.classic.Level.ERROR in project neonbee by SAP.
the class LoggerManagerVerticleTest method testUpdateData.
@Test
@Timeout(value = 2, timeUnit = TimeUnit.SECONDS)
void testUpdateData(VertxTestContext testContext) {
List<LoggerConfiguration> configList = List.of(new LoggerConfiguration("io.neonbee.internal", ERROR), new LoggerConfiguration("io.vertx.core.file", ERROR));
DataRequest updateReq = new DataRequest(LoggerManagerVerticle.QUALIFIED_NAME, new DataQuery().setAction(DataAction.UPDATE).setBody(new JsonArray(configList.stream().map(LoggerConfiguration::toJson).collect(Collectors.toList())).toBuffer()));
requestData(updateReq).compose(updateResponse -> {
return this.<JsonArray>requestData(new DataRequest(LoggerManagerVerticle.QUALIFIED_NAME, new DataQuery()));
}).onComplete(testContext.<JsonArray>succeeding(resp -> {
assertThat(resp).isNotEmpty();
Optional<String> level = resp.stream().map(JsonObject.class::cast).map(LoggerConfiguration::fromJson).filter(config -> "io.neonbee.internal".equals(config.getName())).findFirst().map(LoggerConfiguration::getConfiguredLevel).map(theLevel -> theLevel.levelStr);
assertThat(level.isPresent()).isTrue();
assertThat(level.get()).isEqualTo("ERROR");
level = resp.stream().map(JsonObject.class::cast).map(LoggerConfiguration::fromJson).filter(config -> "io.vertx.core.file".equals(config.getName())).findFirst().map(LoggerConfiguration::getConfiguredLevel).map(theLevel -> theLevel.levelStr);
assertThat(level.isPresent()).isTrue();
assertThat(level.get()).isEqualTo("ERROR");
testContext.completeNow();
}));
}
use of ch.qos.logback.classic.Level.ERROR in project styx by ExpediaGroup.
the class FsmEventProcessorTest method setUp.
@BeforeEach
public void setUp() {
stateMachine = new StateMachine.Builder<String>().initialState("start").transition("start", TestEventOk.class, event -> "end").transition("start", TestEventError.class, event -> {
throw new RuntimeException("Test exception message");
}).onInappropriateEvent((x, y) -> "error").build();
errorHandler = mock(BiConsumer.class);
logger = new LoggingTestSupport(FsmEventProcessor.class);
}
Aggregations