use of com.marcnuri.yakc.api.events.v1.EventsV1Api.ListNamespacedEvent in project yakc by manusa.
the class EventsV1ApiIT method listNamespacedEventStream.
@Test
@DisplayName("listNamespacedEvent.stream, cluster contains events")
void listNamespacedEventStream() throws IOException {
// TODO: Use specific event because events from cluster may come with eventTime null :O -->
// this throws a NPE
// When
final Stream<Event> result = KC.create(EventsV1Api.class).listNamespacedEvent(NAMESPACE, new ListNamespacedEvent().fieldSelector(String.format("metadata.name=%s", eventName))).stream();
// Then
assertThat(result).hasSize(1).allSatisfy(e -> assertThat(e).hasFieldOrPropertyWithValue("metadata.name", eventName).hasFieldOrPropertyWithValue("action", "mock-action"));
}
Aggregations