@Test
public void testLoadProductWithAttributes() throws Exception {

    // given
    String productReleaseJson = "{\"productRelease\":{" + "\"version\":\"0.6.0\"," + "\"product\":{"
        + "\"name\":\"orion\"," + "\"description\":\"\"," + "\"attributes\":["
        + "{\"key\":\"openports\",\"value\":\"1026 27017 27018 27019 28017\"},"
        + "{\"key\":\"dd\",\"value\":\"dd\",\"description\":\"dd\"}" + "]," + "\"metadatas\":["
        + "{\"key\":\"image\",\"value\":\"df44f62d-9d66-4dc5-b084-2d6c7bc4cfe4\"},"
        + "{\"key\":\"cookbook_url\",\"value\":\"\"}," + "{\"key\":\"cloud\",\"value\":\"yes\"},"
        + "{\"key\":\"installator\",\"value\":\"chef\"}," + "{\"key\":\"open_ports\",\"value\":\"80 22\"}"
        + "]" + "}}}";
    Response response = mock(Response.class);
    com.telefonica.euro_iaas.sdc.model.ProductRelease productRelease = new com.telefonica.euro_iaas.sdc.model.ProductRelease();
    productRelease.setProduct(new com.telefonica.euro_iaas.sdc.model.Product("orion", "descr"));
    productRelease.setVersion("0.6.0");
    when(builder.get()).thenReturn(response);
    when(pIService.load(anyString(), anyString(), anyString(), anyString())).thenReturn(productRelease);
    when(sdcClient.getProductReleaseService(anyString(), anyString())).thenReturn(pIService);
    when(response.readEntity(String.class)).thenReturn(productReleaseJson);
    ClaudiaData claudiaData = new ClaudiaData("org", "tenantId", "service");
    PaasManagerUser user = new PaasManagerUser("user", "pass");
    user.setToken("token");
    claudiaData.setUser(user);
    ProductRelease product = productReleaseSdcDaoImpl.load("orion", "0.6.0",
        claudiaData);
    // then
    assertNotNull(product);
}