예제 #1
0
  @Test
  public void testGetProductOperationNotFound() throws Exception {

    Response response = restService.getTrackerOperation(SOURCE, OPERATION_ID2.toString());

    assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus());
  }
예제 #2
0
  @Test
  public void testGetProductOperationException() throws Exception {

    Response response = restService.getTrackerOperation(SOURCE, null);

    assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus());
  }
예제 #3
0
  @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);
  }
예제 #4
0
  @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());
  }
예제 #5
0
  @Test
  public void testGetProductOperationSources() throws Exception {
    Response response = restService.getTrackerOperationSources();

    assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
  }