@Test
public void shouldListApplications() throws Exception {
Connector connector = mock(Connector.class);
ConnectorService cs = mock(ConnectorService.class);
when( cs.getId() ).thenReturn("test-application");
when( cs.getConnector() ).thenReturn( connector );
when( cs.getState() ).thenReturn( State.STARTED );
when( cs.getStatus() ).thenReturn( Status.UNKNOWN );
when( cs.getNumQueuedMessages() ).thenReturn(0);
when( cs.getPriority() ).thenReturn(1000);
RoutingEngine routingEngine = getSpringContext().getBean(RoutingEngine.class);
Mockito.when(routingEngine.getApplications()).thenReturn( Collections.singletonList(cs) );
MockResponse response = get("/applications").addCookie(new Cookie("access_token", "true")).run();