@@ -0,0 +1,2564 @@
+/*%0A * Copyright 2020-2020 Equinix, Inc%0A * Copyright 2014-2020 The Billing Project, LLC%0A *%0A * The Billing Project licenses this file to you under the Apache License, version 2.0%0A * (the %22License%22); you may not use this file except in compliance with the%0A * License.  You may obtain a copy of the License at:%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage org.killbill.billing.beatrix.integration;%0A%0Aimport java.io.IOException;%0A%0Aimport org.joda.time.DateTime;%0Aimport org.killbill.billing.account.api.Account;%0Aimport org.killbill.billing.catalog.api.CatalogApiException;%0Aimport org.killbill.billing.catalog.api.VersionedCatalog;%0Aimport org.killbill.billing.util.callcontext.CallContext;%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.BeforeMethod;%0Aimport org.testng.annotations.Test;%0A%0Aimport com.google.common.base.Charsets;%0Aimport com.google.common.io.Resources;%0A%0Apublic class TestCatalogValidation extends TestIntegrationBase %7B%0A%0A    private CallContext testCallContext;%0A    private Account account;%0A%0A    @BeforeMethod(groups = %22slow%22)%0A    public void beforeMethod() throws Exception %7B%0A        if (hasFailed()) %7B%0A            return;%0A        %7D%0A%0A        super.beforeMethod();%0A%0A        // Setup tenant%0A        clock.setTime(new DateTime(%222020-09-20T12:56:02%22));%0A        testCallContext = setupTenant();%0A%0A        // Setup account in right tenant%0A        account = setupAccount(testCallContext);%0A    %7D%0A%0A    @Test(groups = %22slow%22, description = %22https://github.com/killbill/killbill/issues/1481%22)%0A    public void testUploadCatalog() throws Exception %7B%0A        uploadCatalog(%22CatalogValidation-v1.xml%22);%0A        assertListenerStatus();%0A        uploadCatalog(%22CatalogValidation-v2.xml%22);%0A        assertListenerStatus();%0A        %0A        final VersionedCatalog catalog = catalogUserApi.getCatalog(%22ExampleCatalog%22, testCallContext);%0A        catalog.getCatalogName();%0A        Assert.assertEquals(catalog.getCatalogName(), %22ExampleCatalog%22);%0A    %7D%0A    %0A    private void uploadCatalog(final String name) throws CatalogApiException, IOException %7B%0A        catalogUserApi.uploadCatalog(Resources.asCharSource(Resources.getResource(%22catalogs/testCatalogValidation/%22 + name), Charsets.UTF_8).read(), testCallContext);%0A    %7D%0A    %0A%0A%7D%0A

Create TestCatalogValidation.java