@POST
  @Path("{id}")
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  public Response deploy(@PathParam("id") String id, Service service) {
    AppCatalogSolrClient sc = new AppCatalogSolrClient();
    try {
      sc.deployApp(id, service);
    } catch (SolrServerException | IOException e) {
      return Response.status(Status.BAD_REQUEST).entity(e.toString()).build();
    }
    YarnServiceClient yc = new YarnServiceClient();
    yc.createApp(service);
    String output = "{\"status\":\"Application deployed.\",\"id\":\"" +
        service.getName() + "\"}";
    return Response.status(Status.ACCEPTED).entity(output).build();
  }
@Test
  void testDeploy() throws Exception {
    String id = "application 1";
    AppListController ac = Mockito.mock(AppListController.class);
    Service service = new Service();
    Response expected = Response.ok().build();
    when(ac.deploy(id, service)).thenReturn(Response.ok().build());
    final Response actual = ac.deploy(id, service);
    assertEquals(expected.getStatus(), actual.getStatus());
  }