use of org.killbill.billing.catalog.VersionedCatalog in project killbill by killbill.
the class TestVersionedCatalogLoader method testLoadCatalogFromExternalFile.
@Test(groups = "fast")
public void testLoadCatalogFromExternalFile() throws CatalogApiException, IOException, URISyntaxException {
final File originFile = new File(Resources.getResource("SpyCarBasic.xml").toURI());
final File destinationFile = new File(Files.createTempDir().toString() + "/SpyCarBasicRelocated.xml");
destinationFile.deleteOnExit();
Files.copy(originFile, destinationFile);
final VersionedCatalog c = loader.loadDefaultCatalog(destinationFile.toURI().toString());
Assert.assertEquals(c.getCatalogName(), "SpyCarBasic");
}
use of org.killbill.billing.catalog.VersionedCatalog in project killbill by killbill.
the class TestVersionedCatalogLoader method testLoadCatalogFromClasspathResourceFolder.
@Test(groups = "fast")
public void testLoadCatalogFromClasspathResourceFolder() throws CatalogApiException {
final VersionedCatalog c = loader.loadDefaultCatalog("SpyCarBasic.xml");
Assert.assertEquals(c.size(), 1);
final DateTime dt = new DateTime("2013-02-08T00:00:00+00:00");
Assert.assertEquals(c.getEffectiveDate(), dt.toDate());
Assert.assertEquals(c.getCatalogName(), "SpyCarBasic");
}
Aggregations