@Test public void testGetProductOperationNotFound() throws Exception { Response response = restService.getTrackerOperation(SOURCE, OPERATION_ID2.toString()); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); }
@Test public void testGetProductOperationException() throws Exception { Response response = restService.getTrackerOperation(SOURCE, null); assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); }
@Test public void testGetProductOperation() throws Exception { Response response = restService.getTrackerOperation(SOURCE, OPERATION_ID.toString()); TrackerOperationView pov = JsonUtil.fromJson(response.getEntity().toString(), TrackerOperationViewImpl.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); assertNotNull(pov); }
@Test public void testGetProductOperations() throws Exception { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Type listPOVType = new TypeToken<List<TrackerOperationViewImpl>>() {}.getType(); Response response = restService.getTrackerOperations(SOURCE, df.format(new Date()), df.format(new Date()), 1); List<TrackerOperationView> pov = JsonUtil.fromJson(response.getEntity().toString(), listPOVType); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); assertTrue(!pov.isEmpty()); }
@Test public void testGetProductOperationSources() throws Exception { Response response = restService.getTrackerOperationSources(); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); }