use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.event.PodEvent in project che-server by eclipse-che.
the class LogWatcherTest method executorIsCalledWhenAllIsSet.
@Test
public void executorIsCalledWhenAllIsSet() throws InfrastructureException {
// given
LogWatcher logWatcher = new LogWatcher(clientFactory, eventsPublisher, WORKSPACE_ID, NAMESPACE, PODNAMES, executor, TIMEOUTS, LIMIT_BYTES);
logWatcher.addLogHandler(handler);
PodEvent podEvent = new PodEvent(POD, "container123", "Started", "someevenbettermessage", "123456789", "987654321");
// when
logWatcher.handle(podEvent);
// then
verify(executor, times(1)).execute(any());
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.event.PodEvent in project che-server by eclipse-che.
the class LogWatcherTest method executorIsNotCalledWhenPodNameDontMatch.
@Test
public void executorIsNotCalledWhenPodNameDontMatch() throws InfrastructureException {
// given
LogWatcher logWatcher = new LogWatcher(clientFactory, eventsPublisher, WORKSPACE_ID, NAMESPACE, PODNAMES, executor, TIMEOUTS, LIMIT_BYTES);
logWatcher.addLogHandler(handler);
PodEvent podEvent = new PodEvent("someOtherPod", "container123", "Started", "someevenbettermessage", "123456789", "987654321");
// when
logWatcher.handle(podEvent);
// then
verify(executor, times(0)).execute(any());
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.event.PodEvent in project che-server by eclipse-che.
the class LogWatcherTest method executorIsNotCalledWhenContainerIsNull.
@Test
public void executorIsNotCalledWhenContainerIsNull() throws InfrastructureException {
// given
LogWatcher logWatcher = new LogWatcher(clientFactory, eventsPublisher, WORKSPACE_ID, NAMESPACE, PODNAMES, executor, TIMEOUTS, LIMIT_BYTES);
logWatcher.addLogHandler(handler);
PodEvent podEvent = new PodEvent(POD, null, "somereallygoodreason", "someevenbettermessage", "123456789", "987654321");
// when
logWatcher.handle(podEvent);
// then
verify(executor, times(0)).execute(any());
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.event.PodEvent in project devspaces-images by redhat-developer.
the class LogWatcherTest method executorIsNotCalledWhenContainerIsNull.
@Test
public void executorIsNotCalledWhenContainerIsNull() throws InfrastructureException {
// given
LogWatcher logWatcher = new LogWatcher(clientFactory, eventsPublisher, WORKSPACE_ID, NAMESPACE, PODNAMES, executor, TIMEOUTS, LIMIT_BYTES);
logWatcher.addLogHandler(handler);
PodEvent podEvent = new PodEvent(POD, null, "somereallygoodreason", "someevenbettermessage", "123456789", "987654321");
// when
logWatcher.handle(podEvent);
// then
verify(executor, times(0)).execute(any());
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.event.PodEvent in project devspaces-images by redhat-developer.
the class LogWatcherTest method executorIsNotCalledWhenReasonIsNotStarted.
@Test
public void executorIsNotCalledWhenReasonIsNotStarted() throws InfrastructureException {
// given
LogWatcher logWatcher = new LogWatcher(clientFactory, eventsPublisher, WORKSPACE_ID, NAMESPACE, PODNAMES, executor, TIMEOUTS, LIMIT_BYTES);
logWatcher.addLogHandler(handler);
PodEvent podEvent = new PodEvent(POD, "container123", "NotStarted", "someevenbettermessage", "123456789", "987654321");
// when
logWatcher.handle(podEvent);
// then
verify(executor, times(0)).execute(any());
}
Aggregations