Skip to content

Commit

Permalink
Update TestCatalog to remove deprecated client api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrossie committed Jan 10, 2017
1 parent ba72085 commit 78ea81c
Showing 1 changed file with 8 additions and 6 deletions.
Expand Up @@ -53,8 +53,8 @@ public class TestCatalog extends TestJaxrsBase {
@Test(groups = "slow", description = "Upload and retrieve a per tenant catalog")
public void testMultiTenantCatalog() throws Exception {
final String versionPath1 = Resources.getResource("SpyCarBasic.xml").getPath();
killBillClient.uploadXMLCatalog(versionPath1, createdBy, reason, comment);
String catalog = killBillClient.getXMLCatalog();
killBillClient.uploadXMLCatalog(versionPath1, requestOptions);
String catalog = killBillClient.getXMLCatalog(requestOptions);
Assert.assertNotNull(catalog);
//
// We can't deserialize the VersionedCatalog using our JAXB models because it contains several
Expand All @@ -66,7 +66,7 @@ public void testMultiTenantCatalog() throws Exception {
public void testCatalog() throws Exception {
final Set<String> allBasePlans = new HashSet<String>();

final List<Catalog> catalogsJson = killBillClient.getJSONCatalog();
final List<Catalog> catalogsJson = killBillClient.getJSONCatalog(requestOptions);

Assert.assertEquals(catalogsJson.get(0).getName(), "Firearms");
Assert.assertEquals(catalogsJson.get(0).getEffectiveDate(), Date.valueOf("2011-01-01"));
Expand Down Expand Up @@ -99,7 +99,7 @@ public void testCatalog() throws Exception {
}

// Retrieve available products (addons) for that base product
final List<PlanDetail> availableAddons = killBillClient.getAvailableAddons(productJson.getName());
final List<PlanDetail> availableAddons = killBillClient.getAvailableAddons(productJson.getName(), requestOptions);
final Set<String> availableAddonsNames = new HashSet<String>();
for (final PlanDetail planDetailJson : availableAddons) {
availableAddonsNames.add(planDetailJson.getProduct());
Expand All @@ -108,7 +108,7 @@ public void testCatalog() throws Exception {
}

// Verify base plans endpoint
final List<PlanDetail> basePlans = killBillClient.getBasePlans();
final List<PlanDetail> basePlans = killBillClient.getBasePlans(requestOptions);
final Set<String> foundBasePlans = new HashSet<String>();
for (final PlanDetail planDetailJson : basePlans) {
foundBasePlans.add(planDetailJson.getPlan());
Expand All @@ -120,7 +120,7 @@ public void testCatalog() throws Exception {
expectedExceptions = KillBillClientException.class,
expectedExceptionsMessageRegExp = "There is no catalog version that applies for the given date.*")
public void testCatalogInvalidDate() throws Exception {
final List<Catalog> catalogsJson = killBillClient.getJSONCatalog(DateTime.parse("2008-01-01"));
final List<Catalog> catalogsJson = killBillClient.getJSONCatalog(DateTime.parse("2008-01-01"), requestOptions);
Assert.fail();
}

Expand Down Expand Up @@ -189,4 +189,6 @@ public void testAddSimplePlanWithoutKBDefault() throws Exception {
Assert.assertEquals(catalogsJson.get(0).getPriceLists().get(0).getPlans().size(), 2);
}



}

1 comment on commit 78ea81c

@pierre
Copy link
Member

@pierre pierre commented on 78ea81c Jan 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.