|
10 | 10 | import org.assertj.core.api.Condition;
|
11 | 11 | import org.junit.jupiter.api.Test;
|
12 | 12 | import org.mockito.invocation.InvocationOnMock;
|
| 13 | +import org.slf4j.Logger; |
| 14 | +import org.slf4j.LoggerFactory; |
13 | 15 |
|
14 | 16 | import java.time.LocalDateTime;
|
15 | 17 | import java.util.ArrayList;
|
|
23 | 25 |
|
24 | 26 | class EventSchedulerTest {
|
25 | 27 |
|
| 28 | + private static final Logger log = LoggerFactory.getLogger(EventSchedulerTest.class); |
| 29 | + |
26 | 30 | public static final int INVOCATION_DURATION = 80;
|
27 | 31 | public static final int MAX_RETRY_ATTEMPTS = 3;
|
28 | 32 | @SuppressWarnings("unchecked")
|
@@ -56,6 +60,7 @@ public void eventsAreNotExecutedConcurrentlyForSameResource() throws Interrupted
|
56 | 60 | eventScheduler.eventReceived(Watcher.Action.MODIFIED, resource2);
|
57 | 61 |
|
58 | 62 | waitTimeForExecution(2);
|
| 63 | + log.info("Event processing details 1.: {}. 2: {}", eventProcessingList.get(0), eventProcessingList.get(1)); |
59 | 64 | assertThat(eventProcessingList).hasSize(2)
|
60 | 65 | .matches(list -> eventProcessingList.get(0).getCustomResource().getMetadata().getResourceVersion().equals("1") &&
|
61 | 66 | eventProcessingList.get(1).getCustomResource().getMetadata().getResourceVersion().equals("2"),
|
@@ -242,5 +247,16 @@ public EventProcessingDetail setAction(Watcher.Action action) {
|
242 | 247 | public Exception getException() {
|
243 | 248 | return exception;
|
244 | 249 | }
|
| 250 | + |
| 251 | + @Override |
| 252 | + public String toString() { |
| 253 | + return "EventProcessingDetail{" + |
| 254 | + "action=" + action + |
| 255 | + ", startTime=" + startTime + |
| 256 | + ", endTime=" + endTime + |
| 257 | + ", customResource=" + customResource + |
| 258 | + ", exception=" + exception + |
| 259 | + '}'; |
| 260 | + } |
245 | 261 | }
|
246 | 262 | }
|
0 commit comments