Search in sources :

Example 1 with ListNamespacedEvent

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"));
}
Also used : ListNamespacedEvent(com.marcnuri.yakc.api.events.v1.EventsV1Api.ListNamespacedEvent) Event(com.marcnuri.yakc.model.io.k8s.api.events.v1.Event) ListNamespacedEvent(com.marcnuri.yakc.api.events.v1.EventsV1Api.ListNamespacedEvent) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

ListNamespacedEvent (com.marcnuri.yakc.api.events.v1.EventsV1Api.ListNamespacedEvent)1 Event (com.marcnuri.yakc.model.io.k8s.api.events.v1.Event)1 DisplayName (org.junit.jupiter.api.DisplayName)1 Test (org.junit.jupiter.api.Test)1