@Test
public void getDelivery(){

    final DbProduct product = new DbProduct();
    product.setName("product1");
    
    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");
    delivery.setDependencies(Lists.newArrayList("module1:1.0.0", "module2:1.0.0"));
    product.getDeliveries().add(delivery);
    
    // creating a dummy product in storage with delivery and its dependencies
    when(repositoryHandler.getProduct(product.getName())).thenReturn(product);
    WebResource resource = client().resource("/" + ServerAPI.PRODUCT_RESOURCE + "/" + product.getName() + ServerAPI.GET_DELIVERIES + "/delivery1/1.0.0");
    ClientResponse response = resource.type(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    Delivery deliveries = response.getEntity(Delivery.class);
    
    //checks
    assertNotNull(deliveries);
    assertEquals(2, deliveries.getDependencies().size());
    assertEquals("1.0.0-1", deliveries.getVersion());
    assertEquals("http://localhost:8080/job/20", deliveries.getJenkinsBuildUrl());
}