Search in sources :

Example 1 with ProductConfig

use of org.jboss.pnc.bacon.pig.impl.config.ProductConfig in project bacon by project-ncl.

the class PncEntitiesImporter method generateProduct.

private Product generateProduct() {
    ProductConfig productConfig = pigConfiguration.getProduct();
    Product product = Product.builder().name(productConfig.getName()).abbreviation(productConfig.getAbbreviation()).build();
    try {
        return productClient.createNew(product);
    } catch (ClientException e) {
        throw new RuntimeException("Failed to create the product", e);
    }
}
Also used : ProductConfig(org.jboss.pnc.bacon.pig.impl.config.ProductConfig) Product(org.jboss.pnc.dto.Product) ClientException(org.jboss.pnc.client.ClientException)

Example 2 with ProductConfig

use of org.jboss.pnc.bacon.pig.impl.config.ProductConfig in project bacon by project-ncl.

the class ResolveOnlyRepositoryTest method mockPigConfigurationAndMethods.

private PigConfiguration mockPigConfigurationAndMethods() {
    PigConfiguration pigConfiguration = Mockito.mock(PigConfiguration.class, Mockito.RETURNS_DEEP_STUBS);
    ProductConfig productConfig = Mockito.mock(ProductConfig.class);
    doReturn(productConfig).when(pigConfiguration).getProduct();
    doReturn("sample").when(productConfig).getName();
    return pigConfiguration;
}
Also used : ProductConfig(org.jboss.pnc.bacon.pig.impl.config.ProductConfig) PigConfiguration(org.jboss.pnc.bacon.pig.impl.config.PigConfiguration)

Aggregations

ProductConfig (org.jboss.pnc.bacon.pig.impl.config.ProductConfig)2 PigConfiguration (org.jboss.pnc.bacon.pig.impl.config.PigConfiguration)1 ClientException (org.jboss.pnc.client.ClientException)1 Product (org.jboss.pnc.dto.Product)1