Search in sources :

Example 11 with OSGIServiceDescriptor

use of org.killbill.billing.osgi.api.OSGIServiceDescriptor in project killbill by killbill.

the class TestRetryablePayment method beforeClass.

@BeforeClass(groups = "fast")
public void beforeClass() throws Exception {
    super.beforeClass();
    account = testHelper.createTestAccount("lolo@gmail.com", false);
    Mockito.when(accountInternalApi.getAccountById(Mockito.<UUID>any(), Mockito.<InternalTenantContext>any())).thenReturn(account);
    //Mockito.when(nonEntityDao.retrieveIdFromObject(Mockito.<Long>any(), Mockito.<ObjectType>any())).thenReturn(uuid);
    retryPluginRegistry.registerService(new OSGIServiceDescriptor() {

        @Override
        public String getPluginSymbolicName() {
            return null;
        }

        @Override
        public String getPluginName() {
            return MockPaymentControlProviderPlugin.PLUGIN_NAME;
        }

        @Override
        public String getRegistrationName() {
            return MockPaymentControlProviderPlugin.PLUGIN_NAME;
        }
    }, mockRetryProviderPlugin);
    EMPTY_PROPERTIES = PluginPropertySerializer.serialize(ImmutableList.<PluginProperty>of());
}
Also used : PluginProperty(org.killbill.billing.payment.api.PluginProperty) OSGIServiceDescriptor(org.killbill.billing.osgi.api.OSGIServiceDescriptor) BeforeClass(org.testng.annotations.BeforeClass)

Example 12 with OSGIServiceDescriptor

use of org.killbill.billing.osgi.api.OSGIServiceDescriptor in project killbill by killbill.

the class TestPaymentGatewayApiWithPaymentControl method beforeMethod.

@BeforeMethod(groups = "fast")
public void beforeMethod() throws Exception {
    super.beforeMethod();
    account = testHelper.createTestAccount("arthur@gmail.com", true);
    paymentOptions = new PaymentOptions() {

        @Override
        public boolean isExternalPayment() {
            return false;
        }

        @Override
        public List<String> getPaymentControlPluginNames() {
            return ImmutableList.of(TestPaymentGatewayApiControlPlugin.PLUGIN_NAME, TestPaymentGatewayApiValidationPlugin.VALIDATION_PLUGIN_NAME);
        }
    };
    plugin = new TestPaymentGatewayApiControlPlugin();
    controlPluginRegistry.registerService(new OSGIServiceDescriptor() {

        @Override
        public String getPluginSymbolicName() {
            return null;
        }

        @Override
        public String getPluginName() {
            return TestPaymentGatewayApiControlPlugin.PLUGIN_NAME;
        }

        @Override
        public String getRegistrationName() {
            return TestPaymentGatewayApiControlPlugin.PLUGIN_NAME;
        }
    }, plugin);
    validationPlugin = new TestPaymentGatewayApiValidationPlugin();
    controlPluginRegistry.registerService(new OSGIServiceDescriptor() {

        @Override
        public String getPluginSymbolicName() {
            return null;
        }

        @Override
        public String getPluginName() {
            return TestPaymentGatewayApiValidationPlugin.VALIDATION_PLUGIN_NAME;
        }

        @Override
        public String getRegistrationName() {
            return TestPaymentGatewayApiValidationPlugin.VALIDATION_PLUGIN_NAME;
        }
    }, validationPlugin);
}
Also used : OSGIServiceDescriptor(org.killbill.billing.osgi.api.OSGIServiceDescriptor) ArrayList(java.util.ArrayList) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 13 with OSGIServiceDescriptor

use of org.killbill.billing.osgi.api.OSGIServiceDescriptor in project killbill by killbill.

the class MockPaymentProviderPluginProvider method get.

@Override
public MockPaymentProviderPlugin get() {
    final MockPaymentProviderPlugin plugin = new MockPaymentProviderPlugin(clock);
    final OSGIServiceDescriptor desc = new OSGIServiceDescriptor() {

        @Override
        public String getPluginSymbolicName() {
            return null;
        }

        @Override
        public String getPluginName() {
            return instanceName;
        }

        @Override
        public String getRegistrationName() {
            return instanceName;
        }
    };
    registry.registerService(desc, plugin);
    return plugin;
}
Also used : OSGIServiceDescriptor(org.killbill.billing.osgi.api.OSGIServiceDescriptor)

Example 14 with OSGIServiceDescriptor

use of org.killbill.billing.osgi.api.OSGIServiceDescriptor in project killbill by killbill.

the class TestPaymentApiWithControl method beforeMethod.

@BeforeMethod(groups = "slow")
public void beforeMethod() throws Exception {
    super.beforeMethod();
    account = testHelper.createTestAccount("bobo@gmail.com", true);
    testPaymentControlPluginApi = new TestPaymentControlPluginApi();
    controlPluginRegistry.registerService(new OSGIServiceDescriptor() {

        @Override
        public String getPluginSymbolicName() {
            return null;
        }

        @Override
        public String getPluginName() {
            return TestPaymentControlPluginApi.PLUGIN_NAME;
        }

        @Override
        public String getRegistrationName() {
            return TestPaymentControlPluginApi.PLUGIN_NAME;
        }
    }, testPaymentControlPluginApi);
}
Also used : OSGIServiceDescriptor(org.killbill.billing.osgi.api.OSGIServiceDescriptor) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 15 with OSGIServiceDescriptor

use of org.killbill.billing.osgi.api.OSGIServiceDescriptor in project killbill by killbill.

the class TestWithCatalogPlugin method beforeClass.

@BeforeClass(groups = "slow")
public void beforeClass() throws Exception {
    super.beforeClass();
    this.testCatalogPluginApi = new TestCatalogPluginApi(priceOverride, internalCallContext, internalCallContextFactory);
    pluginRegistry.registerService(new OSGIServiceDescriptor() {

        @Override
        public String getPluginSymbolicName() {
            return "TestCatalogPluginApi";
        }

        @Override
        public String getPluginName() {
            return "TestCatalogPluginApi";
        }

        @Override
        public String getRegistrationName() {
            return "TestCatalogPluginApi";
        }
    }, testCatalogPluginApi);
}
Also used : OSGIServiceDescriptor(org.killbill.billing.osgi.api.OSGIServiceDescriptor) PriceOverride(org.killbill.billing.catalog.override.PriceOverride) StandaloneCatalogWithPriceOverride(org.killbill.billing.catalog.StandaloneCatalogWithPriceOverride) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

OSGIServiceDescriptor (org.killbill.billing.osgi.api.OSGIServiceDescriptor)15 BeforeMethod (org.testng.annotations.BeforeMethod)6 BeforeClass (org.testng.annotations.BeforeClass)5 MockPaymentControlProviderPlugin (org.killbill.billing.payment.provider.MockPaymentControlProviderPlugin)3 ImmutableList (com.google.common.collect.ImmutableList)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 PluginProperty (org.killbill.billing.payment.api.PluginProperty)2 DefaultPlanPhasePriceOverride (org.killbill.billing.catalog.DefaultPlanPhasePriceOverride)1 StandaloneCatalogWithPriceOverride (org.killbill.billing.catalog.StandaloneCatalogWithPriceOverride)1 PlanPhasePriceOverride (org.killbill.billing.catalog.api.PlanPhasePriceOverride)1 PriceOverride (org.killbill.billing.catalog.override.PriceOverride)1 PaymentControlPluginApi (org.killbill.billing.control.plugin.api.PaymentControlPluginApi)1 PaymentOptions (org.killbill.billing.payment.api.PaymentOptions)1 DefaultPaymentControlProviderPluginRegistry (org.killbill.billing.payment.provider.DefaultPaymentControlProviderPluginRegistry)1 DefaultPaymentProviderPluginRegistry (org.killbill.billing.payment.provider.DefaultPaymentProviderPluginRegistry)1