Search in sources :

Example 1 with TimeLimiterOnErrorEvent

use of io.github.resilience4j.timelimiter.event.TimeLimiterOnErrorEvent in project resilience4j by resilience4j.

the class TimeLimiterEventDTOTest method shouldMapTimeLimiterOnErrorEvent.

@Test
public void shouldMapTimeLimiterOnErrorEvent() {
    TimeLimiterOnErrorEvent event = new TimeLimiterOnErrorEvent("name", new IOException("Error message"));
    TimeLimiterEventDTO timeLimiterEventDTO = TimeLimiterEventDTO.createTimeLimiterEventDTO(event);
    assertThat(timeLimiterEventDTO.getTimeLimiterName()).isEqualTo("name");
    assertThat(timeLimiterEventDTO.getType()).isEqualTo(TimeLimiterEvent.Type.ERROR);
    assertThat(timeLimiterEventDTO.getCreationTime()).isNotNull();
}
Also used : TimeLimiterEventDTO(io.github.resilience4j.common.timelimiter.monitoring.endpoint.TimeLimiterEventDTO) IOException(java.io.IOException) TimeLimiterOnErrorEvent(io.github.resilience4j.timelimiter.event.TimeLimiterOnErrorEvent) Test(org.junit.Test)

Aggregations

TimeLimiterEventDTO (io.github.resilience4j.common.timelimiter.monitoring.endpoint.TimeLimiterEventDTO)1 TimeLimiterOnErrorEvent (io.github.resilience4j.timelimiter.event.TimeLimiterOnErrorEvent)1 IOException (java.io.IOException)1 Test (org.junit.Test)1