@Test public void testGetLogbookStatisticsWithSuccess() throws Exception { VitamContext context = new VitamContext(TENANT_ID); context.setAccessContract(DEFAULT_CONTRACT_NAME).setApplicationSessionId(getAppSessionId()); when( userInterfaceTransactionManager.selectOperationbyId(FAKE_OPERATION_ID, context)) .thenReturn(RequestResponseOK.getFromJsonNode(sampleLogbookOperation, LogbookOperation.class)); given().param("id_op", FAKE_OPERATION_ID).header(GlobalDataRest.X_CSRF_TOKEN, tokenCSRF).cookie(COOKIE) .expect().statusCode(Status.OK.getStatusCode()).when().get("/stat/" + FAKE_OPERATION_ID); }
private static String getAppSessionId() { return "MyApplicationId-ChangeIt"; }
WebApplicationResource extends ApplicationStatusResource { private static String getAppSessionId() { return "MyApplicationId-ChangeIt"; } }
WebApplicationResource extends ApplicationStatusResource { private static String getAppSessionId() { return "MyApplicationId-ChangeIt"; } WebApplicationResource(WebApplicationConfig webApplicationConfigonfig,
        UserInterfaceTransactionManager userInterfaceTransactionManager,
        PaginationHelper paginationHelper, DslQueryHelper dslQueryHelper,
        StorageService storageService); }
WebApplicationResource extends ApplicationStatusResource { private static String getAppSessionId() { return "MyApplicationId-ChangeIt"; } WebApplicationResource(WebApplicationConfig webApplicationConfigonfig,
        UserInterfaceTransactionManager userInterfaceTransactionManager,
        PaginationHelper paginationHelper, DslQueryHelper dslQueryHelper,
        StorageService storageService); @POST @Path("/replaceObject/{dataType}/{strategyId}/{offerId}/{uid}/{size}") @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_JSON) Response uploadObject(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("uid") String uid, @PathParam("dataType") String dataType,
        @PathParam("strategyId") String strategyId, @PathParam("offerId") String offerId, @PathParam("size") Long size,
        InputStream input); @GET @Path("/strategies") @Produces(MediaType.APPLICATION_JSON) Response getStrategies(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @DELETE @Path("/deleteObject/{dataType}/{strategyId}/{offerId}/{uid}") @Produces(MediaType.APPLICATION_JSON) Response deleteObject(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("uid") String uid, @PathParam("dataType") String dataType,
        @PathParam("strategyId") String strategyId, @PathParam("offerId") String offerId); @POST @Path("/launchAudit/{operationId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Deprecated Response launchAudit(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @HeaderParam(GlobalDataRest.X_ACCESS_CONTRAT_ID) String xAccessContratId,
        @PathParam("operationId") String operationId); @POST @Path("/ingestcleanup/{operationId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response launchIngestCleanup(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId, @HeaderParam(GlobalDataRest.X_ACCESS_CONTRAT_ID) String xAccessContratId, @PathParam("operationId") String operationId); @GET @Path("/download/{strategyId}/{offerId}/{dataType}/{uid}") @Produces(MediaType.APPLICATION_OCTET_STREAM) Response getObjectAsInputStreamAsync(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("uid") String uid,
        @PathParam("dataType") String dataType,
        @PathParam("strategyId") String strategyId,
        @PathParam("offerId") String offerId); @POST @Path("/readorder/{strategyId}/{offerId}/{dataType}/{uid}") @Produces(MediaType.APPLICATION_JSON) Response createReadOrderRequest(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("strategyId") String strategyId,
        @PathParam("offerId") String offerId,
        @PathParam("dataType") String dataType,
        @PathParam("uid") String uid); @GET @Path("/readorder/{strategyId}/{offerId}/{readOrderId}") @Consumes(MediaType.APPLICATION_JSON) Response getReadOrderRequest(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("strategyId") String strategyId,
        @PathParam("offerId") String offerId,
        @PathParam("readOrderId") String readOrderId); @GET @Path("/messages/logbook") @Produces(MediaType.APPLICATION_JSON) Response getLogbookMessages(); @POST @Path("login") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response login(@Context HttpServletRequest httpRequest, JsonNode object); @GET @Path("/stat/{id_op}") @Produces(MediaType.TEXT_PLAIN) Response getLogbookStatistics(@PathParam("id_op") String operationId); @GET @Path("/securemode") @Produces(MediaType.APPLICATION_JSON) Response getSecureMode(); @POST @Path("/operations/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceability(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @POST @Path("/lifecycles/units/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceabilityLfcUnit(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @POST @Path("/lifecycles/objectgroups/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceabilityLfcObjectGroup(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @POST @Path("/storages/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceabilityStorage(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @POST @Path("/logbooks") @Produces(MediaType.APPLICATION_JSON) Response getLogbookResultByBrowser(@Context HttpServletRequest request,
        @HeaderParam(GlobalDataRest.X_HTTP_METHOD_OVERRIDE) String xhttpOverride,
        @CookieParam("JSESSIONID") String sessionId,
        String options); @POST @Path("/updateLinks") @Produces(MediaType.APPLICATION_JSON) Response updateLinksBetweenAU(@Context HttpServletRequest request, String select); @GET @Path("/logbooks") @Produces(MediaType.APPLICATION_JSON) Response getLogbookResult(@Context HttpServletRequest request, @CookieParam("JSESSIONID") String sessionId,
        String options); @GET @Path("/logbooks/{idOperation}") @Produces(MediaType.APPLICATION_JSON) Response getLogbookResultById(@PathParam("idOperation") String operationId,
        @HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @GET @Path("/logbooks/{idOperation}") @Produces(MediaType.APPLICATION_OCTET_STREAM) void downloadObjectAsStream(@PathParam("idOperation") String operationId,
        @Suspended final AsyncResponse asyncResponse, @QueryParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @GET @Path("/logbooks/{idOperation}/content") @Produces(MediaType.APPLICATION_OCTET_STREAM) void downloadObjectAsStreamForBrowser(@PathParam("idOperation") String operationId,
        @Suspended final AsyncResponse asyncResponse, @QueryParam(GlobalDataRest.X_TENANT_ID) Integer tenantId); @POST @Path("/accesscontracts") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response findAccessContract(@Context HttpServletRequest request, String select); @POST @Path("/dslQueryTest") @Produces(MediaType.APPLICATION_JSON) Response getAndExecuteTestRequest(@Context HttpServletRequest request,
        @CookieParam("JSESSIONID") String sessionId,
        JsonNode criteria); }
WebApplicationResource extends ApplicationStatusResource { private static String getAppSessionId() { return "MyApplicationId-ChangeIt"; } WebApplicationResource(WebApplicationConfig webApplicationConfigonfig,
        UserInterfaceTransactionManager userInterfaceTransactionManager,
        PaginationHelper paginationHelper, DslQueryHelper dslQueryHelper,
        StorageService storageService); @POST @Path("/replaceObject/{dataType}/{strategyId}/{offerId}/{uid}/{size}") @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_JSON) Response uploadObject(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("uid") String uid, @PathParam("dataType") String dataType,
        @PathParam("strategyId") String strategyId, @PathParam("offerId") String offerId, @PathParam("size") Long size,
        InputStream input); @GET @Path("/strategies") @Produces(MediaType.APPLICATION_JSON) Response getStrategies(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @DELETE @Path("/deleteObject/{dataType}/{strategyId}/{offerId}/{uid}") @Produces(MediaType.APPLICATION_JSON) Response deleteObject(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("uid") String uid, @PathParam("dataType") String dataType,
        @PathParam("strategyId") String strategyId, @PathParam("offerId") String offerId); @POST @Path("/launchAudit/{operationId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Deprecated Response launchAudit(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @HeaderParam(GlobalDataRest.X_ACCESS_CONTRAT_ID) String xAccessContratId,
        @PathParam("operationId") String operationId); @POST @Path("/ingestcleanup/{operationId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response launchIngestCleanup(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId, @HeaderParam(GlobalDataRest.X_ACCESS_CONTRAT_ID) String xAccessContratId, @PathParam("operationId") String operationId); @GET @Path("/download/{strategyId}/{offerId}/{dataType}/{uid}") @Produces(MediaType.APPLICATION_OCTET_STREAM) Response getObjectAsInputStreamAsync(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("uid") String uid,
        @PathParam("dataType") String dataType,
        @PathParam("strategyId") String strategyId,
        @PathParam("offerId") String offerId); @POST @Path("/readorder/{strategyId}/{offerId}/{dataType}/{uid}") @Produces(MediaType.APPLICATION_JSON) Response createReadOrderRequest(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("strategyId") String strategyId,
        @PathParam("offerId") String offerId,
        @PathParam("dataType") String dataType,
        @PathParam("uid") String uid); @GET @Path("/readorder/{strategyId}/{offerId}/{readOrderId}") @Consumes(MediaType.APPLICATION_JSON) Response getReadOrderRequest(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId,
        @PathParam("strategyId") String strategyId,
        @PathParam("offerId") String offerId,
        @PathParam("readOrderId") String readOrderId); @GET @Path("/messages/logbook") @Produces(MediaType.APPLICATION_JSON) Response getLogbookMessages(); @POST @Path("login") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response login(@Context HttpServletRequest httpRequest, JsonNode object); @GET @Path("/stat/{id_op}") @Produces(MediaType.TEXT_PLAIN) Response getLogbookStatistics(@PathParam("id_op") String operationId); @GET @Path("/securemode") @Produces(MediaType.APPLICATION_JSON) Response getSecureMode(); @POST @Path("/operations/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceability(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @POST @Path("/lifecycles/units/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceabilityLfcUnit(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @POST @Path("/lifecycles/objectgroups/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceabilityLfcObjectGroup(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @POST @Path("/storages/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceabilityStorage(@HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @POST @Path("/logbooks") @Produces(MediaType.APPLICATION_JSON) Response getLogbookResultByBrowser(@Context HttpServletRequest request,
        @HeaderParam(GlobalDataRest.X_HTTP_METHOD_OVERRIDE) String xhttpOverride,
        @CookieParam("JSESSIONID") String sessionId,
        String options); @POST @Path("/updateLinks") @Produces(MediaType.APPLICATION_JSON) Response updateLinksBetweenAU(@Context HttpServletRequest request, String select); @GET @Path("/logbooks") @Produces(MediaType.APPLICATION_JSON) Response getLogbookResult(@Context HttpServletRequest request, @CookieParam("JSESSIONID") String sessionId,
        String options); @GET @Path("/logbooks/{idOperation}") @Produces(MediaType.APPLICATION_JSON) Response getLogbookResultById(@PathParam("idOperation") String operationId,
        @HeaderParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @GET @Path("/logbooks/{idOperation}") @Produces(MediaType.APPLICATION_OCTET_STREAM) void downloadObjectAsStream(@PathParam("idOperation") String operationId,
        @Suspended final AsyncResponse asyncResponse, @QueryParam(GlobalDataRest.X_TENANT_ID) String xTenantId); @GET @Path("/logbooks/{idOperation}/content") @Produces(MediaType.APPLICATION_OCTET_STREAM) void downloadObjectAsStreamForBrowser(@PathParam("idOperation") String operationId,
        @Suspended final AsyncResponse asyncResponse, @QueryParam(GlobalDataRest.X_TENANT_ID) Integer tenantId); @POST @Path("/accesscontracts") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response findAccessContract(@Context HttpServletRequest request, String select); @POST @Path("/dslQueryTest") @Produces(MediaType.APPLICATION_JSON) Response getAndExecuteTestRequest(@Context HttpServletRequest request,
        @CookieParam("JSESSIONID") String sessionId,
        JsonNode criteria); static final String DEFAULT_CONTRACT_NAME; }