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();
Assert.assertEquals( response.getStatus(), Response.OK );
JSONArray jsonResponse = new JSONArray( response.getOutputAsString() );
Assert.assertNotNull( jsonResponse );
Assert.assertEquals( jsonResponse.length(), 1 );
JSONObject jsonConnection = jsonResponse.getJSONObject(0);
Assert.assertNotNull( jsonConnection );