Test cases for 1465
Adding test case for
package org.killbill.billing.beatrix.integration;
import static org.testng.Assert.assertEquals;
-
+import static org.testng.Assert.assertNotEquals;
import java.io.IOException;
import org.joda.time.DateTime;
import org.killbill.billing.ErrorCode;
import org.killbill.billing.account.api.Account;
import org.killbill.billing.catalog.api.CatalogApiException;
-import org.killbill.billing.catalog.api.VersionedCatalog;
import org.killbill.billing.util.callcontext.CallContext;
-import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -67,6 +65,24 @@ public class TestCatalogValidation extends TestIntegrationBase {
}
}
+ @Test(groups = "slow", description = "https://github.com/killbill/killbill/issues/1465")
+ public void testUploadCatalogPlanValidation() throws Exception {
+ try {
+ uploadCatalog("CatalogValidation-v2.xml");
+ assertListenerStatus();
+ } catch (CatalogApiException cApiException) {
+ assertEquals(cApiException.getCode(), ErrorCode.CAT_INVALID_FOR_TENANT.getCode());
+ }
+
+ try {
+ uploadCatalog("CatalogValidation-v3.xml");
+ assertListenerStatus();
+ } catch (CatalogApiException cApiException) {
+ //assertEquals(cApiException.getCode(), ErrorCode.CAT_INVALID_FOR_TENANT.getCode());
+ assertNotEquals(cApiException.getCode(), ErrorCode.CAT_INVALID_FOR_TENANT.getCode());
+ }
+
+ }
private void uploadCatalog(final String name) throws CatalogApiException, IOException {
catalogUserApi.uploadCatalog(Resources.asCharSource(Resources.getResource("catalogs/testCatalogValidation/" + name), Charsets.UTF_8).read(), testCallContext);
}
