use of org.candlepin.model.DistributorVersionCurator in project candlepin by candlepin.
the class ImporterTest method importDistributorVersionCreate.
@Test
public void importDistributorVersionCreate() throws Exception {
DistributorVersionCurator dvc = mock(DistributorVersionCurator.class);
Importer i = new Importer(null, null, null, null, null, null, null, null, null, null, null, null, i18n, dvc, null, su, null, this.mockSubReconciler, this.ec, this.translator);
File[] distVer = new File[1];
distVer[0] = new File(folder.getRoot(), "dist-ver.json");
mapper.writeValue(distVer[0], createTestDistributerVersion());
i.importDistributorVersions(distVer);
verify(dvc).create(any(DistributorVersion.class));
verify(dvc, never()).merge(any(DistributorVersion.class));
}
use of org.candlepin.model.DistributorVersionCurator in project candlepin by candlepin.
the class ImporterTest method importDistributorVersionUpdate.
@Test
public void importDistributorVersionUpdate() throws Exception {
DistributorVersionCurator dvc = mock(DistributorVersionCurator.class);
Importer i = new Importer(null, null, null, null, null, null, null, null, null, null, null, null, i18n, dvc, null, su, null, this.mockSubReconciler, this.ec, this.translator);
when(dvc.findByName("test-dist-ver")).thenReturn(new DistributorVersion("test-dist-ver"));
File[] distVer = new File[1];
distVer[0] = new File(folder.getRoot(), "dist-ver.json");
mapper.writeValue(distVer[0], createTestDistributerVersion());
i.importDistributorVersions(distVer);
verify(dvc, never()).create(any(DistributorVersion.class));
verify(dvc).merge(any(DistributorVersion.class));
}
Aggregations