use of org.candlepin.model.EnvironmentCurator in project candlepin by candlepin.
the class ProductExporterTest method testProductExport.
@Test
public void testProductExport() throws IOException {
ObjectMapper mapper = TestSyncUtils.getTestSyncUtils(new MapConfiguration(new HashMap<String, String>() {
{
put(ConfigProperties.FAIL_ON_UNKNOWN_IMPORT_PROPERTIES, "false");
}
}));
ProductExporter exporter = new ProductExporter(new StandardTranslator(new ConsumerTypeCurator(), new EnvironmentCurator(), new OwnerCurator()));
StringWriter writer = new StringWriter();
Owner owner = TestUtil.createOwner("Example-Corporation");
Product product = TestUtil.createProduct("my-id", "product name");
exporter.export(mapper, writer, product);
String s = writer.toString();
assertTrue(s.contains("\"name\":\"product name\""));
assertTrue(s.contains("\"id\":\"my-id\""));
assertTrue(s.contains("\"productContent\":[]"));
assertTrue(s.contains("\"attributes\":[]"));
assertTrue(s.contains("\"multiplier\":1"));
}
use of org.candlepin.model.EnvironmentCurator in project candlepin by candlepin.
the class SubscriptionReconcilerTest method init.
@Before
public void init() {
this.owner = new Owner();
this.reconciler = new SubscriptionReconciler(this.poolCurator);
this.translator = new StandardTranslator(new ConsumerTypeCurator(), new EnvironmentCurator(), new OwnerCurator());
i18n = I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK);
this.importer = new EntitlementImporter(certSerialCurator, cdnCurator, i18n, pc, ec, translator);
}
Aggregations