ApplicationResource { @GET @Consumes(MediaType.APPLICATION_JSON) @Timed @UnitOfWork(transactional = false) @Path("{tenant}/{name}/marathon") @ApiOperation(value = "Get application details from marathon", response = Map.class) public Response getFromMarathon(@PathParam("tenant") final String tenant, @PathParam("name") final String computationName) { final String appName = applicationService.name(tenant, computationName); final Map result = applicationService.getAppFromDeploymentEnv(appName); return Response.ok().entity(result).build(); }  @POST @UserRequired @Consumes(MediaType.APPLICATION_JSON) @Timed @UnitOfWork @Path("{tenant}/{name}") @ApiOperation(value = "Creates and deploys an application for a computation given tenant and name", response = ApplicationDomain.class) Response create(@PathParam("tenant") final String tenant, @PathParam("name") final String computationName,
                           @QueryParam("version") final Integer computationVersion,
                           @NotNull final RuntimeOptions runtimeOptions); @GET @Consumes(MediaType.APPLICATION_JSON) @Timed @UnitOfWork(transactional = false) @Path("{tenant}/{name}") @ApiOperation(value = "Get application(only metadata from db)", response = ApplicationDomain.class) Response get(@PathParam("tenant") final String tenant, @PathParam("name") final String computationName); @GET @Consumes(MediaType.APPLICATION_JSON) @Timed @UnitOfWork(transactional = false) @Path("{tenant}/{name}/marathon") @ApiOperation(value = "Get application details from marathon", response = Map.class) Response getFromMarathon(@PathParam("tenant") final String tenant,
                                    @PathParam("name") final String computationName); @DELETE @Consumes(MediaType.APPLICATION_JSON) @Timed @UserRequired @UnitOfWork @Path("{tenant}/{name}") @ApiOperation(value = "Delete application details from marathon and soft deletes the meta") Response delete(@PathParam("tenant") final String tenant, @PathParam("name") final String computationName); @PUT @Consumes(MediaType.APPLICATION_JSON) @Timed @UserRequired @UnitOfWork @Path("{tenant}/{name}/scale") @ApiOperation(value = "Scales application on marathon") Response scale(@PathParam("tenant") final String tenant, @PathParam("name") final String computationName,
                          @NotNull final Map<String, Integer> request); @PUT @Consumes(MediaType.APPLICATION_JSON) @Timed @UserRequired @UnitOfWork @Path("{tenant}/{name}/suspend") @ApiOperation(value = "Suspends application on marathon") Response suspend(@PathParam("tenant") final String tenant, @PathParam("name") final String computationName); @PUT @Consumes(MediaType.APPLICATION_JSON) @Timed @UnitOfWork @UserRequired @Path("{tenant}/{name}/restart") @ApiOperation(value = "Restart application on marathon") Response restart(@PathParam("tenant") final String tenant, @PathParam("name") final String computationName,
                            @QueryParam("forcefully") @DefaultValue("false") final boolean forcefully);  }
@Test public void testGetFromMarathon() { Map map = Collections.singletonMap("response", new GetAppResponse()); doReturn(map).when(applicationService).getAppFromDeploymentEnv(anyString()); final Response response = resource.getFromMarathon(application.getTenant(), application.getName()); Assert.assertEquals(response.getStatus(), 200); Assert.assertEquals(response.getEntity(), map); }