Package org.candlepin.model

Examples of org.candlepin.model.Content


        Product engProduct = new Product(Integer.toString(TestUtil.randomInt()),
            "An ENG product");

        Set<Content> productContent = new HashSet<Content>();
        for (int i = 0; i < X509ExtensionUtil.V1_CONTENT_LIMIT + 1; i++) {
            productContent.add(new Content("fake" + i, "fake" + i,
                "fake" + i, "yum", "vendor", "", "", ""));
        }

        engProduct.setContent(productContent);
        Pool pool = TestUtil.createPool(owner, mktProduct);
View Full Code Here


        Product engProduct = new Product(Integer.toString(TestUtil.randomInt()),
            "An ENG product");

        Set<Content> productContent = new HashSet<Content>();
        for (int i = 0; i < X509ExtensionUtil.V1_CONTENT_LIMIT + 1; i++) {
            productContent.add(new Content("fake" + i, "fake" + i,
                "fake" + i, "yum", "vendor", "", "", ""));
        }

        engProduct.setContent(productContent);
        Pool pool = TestUtil.createPool(owner, mktProduct);
View Full Code Here

        cr.getContent("10");
    }

    @Test
    public void getContent() {
        Content content = mock(Content.class);
        when(cc.find(eq("10"))).thenReturn(content);
        assertEquals(content, cr.getContent("10"));
    }
View Full Code Here

        assertEquals(content, cr.getContent("10"));
    }

    @Test
    public void createContent() {
        Content content = mock(Content.class);
        when(content.getId()).thenReturn("10");
        when(cc.find(eq("10"))).thenReturn(content);
        assertEquals(content, cr.createContent(content));
    }
View Full Code Here

        assertEquals(content, cr.createContent(content));
    }

    @Test
    public void createContentNull()  {
        Content content = mock(Content.class);
        when(content.getId()).thenReturn("10");
        when(cc.find(eq(10L))).thenReturn(null);
        cr.createContent(content);
        verify(cc, atLeastOnce()).create(content);
    }
View Full Code Here

        verify(cc, atLeastOnce()).create(content);
    }

    @Test
    public void deleteContent() {
        Content content = mock(Content.class);
        when(content.getId()).thenReturn("10");
        when(cc.find(eq("10"))).thenReturn(content);
        EnvironmentContent ec =
            new EnvironmentContent(mock(Environment.class), content.getId(), true);
        List<EnvironmentContent> envContents = listFrom(ec);
        when(envContentCurator.lookupByContent(content.getId())).thenReturn(envContents);

        cr.remove("10");

        verify(cc, atLeastOnce()).delete(eq(content));
        verify(envContentCurator, atLeastOnce()).delete(eq(ec));
View Full Code Here

        verify(envContentCurator, atLeastOnce()).delete(eq(ec));
    }

    @Test(expected = BadRequestException.class)
    public void deleteContentNull() {
        Content content = mock(Content.class);
        when(content.getId()).thenReturn("10");
        when(cc.find(eq("10"))).thenReturn(null);
        cr.remove("10");
        verify(cc, never()).delete(eq(content));
    }
View Full Code Here

    }

    @Test
    public void testUpdateContent() {
        final String contentId = "10";
        Content content = mock(Content.class);
        when(content.getId()).thenReturn(contentId);

        when(cc.find(any(String.class))).thenReturn(content);
        when(cc.createOrUpdate(any(Content.class))).thenReturn(content);
        when(productAdapter.getProductsWithContent(
            eq(setFrom(contentId)))).thenReturn(setFrom("productid"));
View Full Code Here

        verify(poolManager).regenerateCertificatesOf(eq("productid"), eq(true));
    }

    @Test(expected = NotFoundException.class)
    public void testUpdateContentThrowsExceptionWhenContentDoesNotExist() {
        Content content = mock(Content.class);
        when(cc.find(any(String.class))).thenReturn(null);

        cr.updateContent("someId", content);
    }
View Full Code Here

    }

    @Override
    public void removeContent(String productId, String contentId) {
        Product product = prodCurator.find(productId);
        Content content = contentCurator.find(contentId);
        prodCurator.removeProductContent(product, content);
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.Content

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.