@Test
public void getDeliveries(){

    final DbProduct product = new DbProduct();
    product.setName("product1");
    
    // creating delivery
    Delivery delivery = new Delivery();
    delivery.setCommercialName("delivery1");
    delivery.setCommercialVersion("1.0.0");
    delivery.setVersion("1.0.0-1");
    delivery.setJenkinsBuildUrl("http://localhost:8080/job/20");
    
    product.getDeliveries().add(delivery);
    
    // creating delivery in storage
    when(repositoryHandler.getProduct(product.getName())).thenReturn(product);
    WebResource resource = client().resource("/" + ServerAPI.PRODUCT_RESOURCE + "/" + product.getName() + ServerAPI.GET_DELIVERIES);
    ClientResponse response = resource.type(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    // checking response status
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    List<Delivery> deliveries = response.getEntity(new GenericType<List<Delivery>>(){});
    
    // checks
    assertNotNull(deliveries);
    assertEquals(1, deliveries.size());
    assertEquals("delivery1", deliveries.get(0).getCommercialName());
    assertEquals("1.0.0-1", deliveries.get(0).getVersion());
    assertEquals("http://localhost:8080/job/20", deliveries.get(0).getJenkinsBuildUrl());
}