Exemplo n.º 1
0
  @Test
  public void testGetProductOperationNotFound() throws Exception {

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

    assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus());
  }
Exemplo n.º 2
0
  @Test
  public void testGetProductOperationException() throws Exception {

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

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

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