Search in sources :

Example 1 with MesosClientErrorContext

use of com.hubspot.mesos.rx.java.MesosClientErrorContext in project Singularity by HubSpot.

the class SingularityMesosSchedulerClientTest method itCheckAndReconnectThrowsException.

@Test
public void itCheckAndReconnectThrowsException() {
    Mesos4xxException exception = new Mesos4xxException(new Object(), new MesosClientErrorContext(403, "Framework not subscribed", new ArrayList<>()));
    doAnswer((InvocationOnMock invocation) -> {
        ((Runnable) invocation.getArguments()[0]).run();
        return null;
    }).when(executorService).execute(any(Runnable.class));
    client.checkAndReconnect(exception).join();
    verify(scheduler, times(1)).onUncaughtException(any());
}
Also used : MesosClientErrorContext(com.hubspot.mesos.rx.java.MesosClientErrorContext) InvocationOnMock(org.mockito.invocation.InvocationOnMock) ArrayList(java.util.ArrayList) Mesos4xxException(com.hubspot.mesos.rx.java.Mesos4xxException) Test(org.junit.jupiter.api.Test)

Aggregations

Mesos4xxException (com.hubspot.mesos.rx.java.Mesos4xxException)1 MesosClientErrorContext (com.hubspot.mesos.rx.java.MesosClientErrorContext)1 ArrayList (java.util.ArrayList)1 Test (org.junit.jupiter.api.Test)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1