Search in sources :

Example 1 with OSGIServiceDescriptor

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

the class TestPaymentPluginProperties method beforeMethod.

@BeforeMethod(groups = "slow")
public void beforeMethod() throws Exception {
    super.beforeMethod();
    mockPaymentControlProviderPlugin = new PluginPropertiesVerificator();
    controlPluginRegistry.registerService(new OSGIServiceDescriptor() {

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

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

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

Example 2 with OSGIServiceDescriptor

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

the class TestPayment method beforeMethod.

@BeforeMethod(groups = "slow")
public void beforeMethod() throws Exception {
    super.beforeMethod();
    mockPaymentProviderPlugin = (MockPaymentProviderPlugin) registry.getServiceForName(PLUGIN_NAME);
    mockPaymentControlProviderPlugin = new MockPaymentControlProviderPlugin();
    controlPluginRegistry.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;
        }
    }, mockPaymentControlProviderPlugin);
}
Also used : OSGIServiceDescriptor(org.killbill.billing.osgi.api.OSGIServiceDescriptor) MockPaymentControlProviderPlugin(org.killbill.billing.payment.provider.MockPaymentControlProviderPlugin) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with OSGIServiceDescriptor

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

the class TestPaymentApi method beforeMethod.

@BeforeMethod(groups = "slow")
public void beforeMethod() throws Exception {
    super.beforeMethod();
    mockPaymentProviderPlugin.clear();
    account = testHelper.createTestAccount("bobo@gmail.com", true);
    mockPaymentControlProviderPlugin = new MockPaymentControlProviderPlugin();
    controlPluginRegistry.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;
        }
    }, mockPaymentControlProviderPlugin);
}
Also used : OSGIServiceDescriptor(org.killbill.billing.osgi.api.OSGIServiceDescriptor) MockPaymentControlProviderPlugin(org.killbill.billing.payment.provider.MockPaymentControlProviderPlugin) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 4 with OSGIServiceDescriptor

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

the class NoOpInvoiceProviderPluginProvider method get.

@Override
public DefaultNoOpInvoiceProviderPlugin get() {
    final DefaultNoOpInvoiceProviderPlugin plugin = new DefaultNoOpInvoiceProviderPlugin(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 5 with OSGIServiceDescriptor

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

the class TestPaymentWithControl method beforeClass.

@BeforeClass(groups = "slow")
public void beforeClass() throws Exception {
    super.beforeClass();
    this.testPaymentControlWithControl = new TestPaymentControlPluginApi();
    pluginRegistry.registerService(new OSGIServiceDescriptor() {

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

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

        @Override
        public String getRegistrationName() {
            return TEST_PAYMENT_WITH_CONTROL;
        }
    }, testPaymentControlWithControl);
    properties = new ArrayList<PluginProperty>();
    paymentOptions = new PaymentOptions() {

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

        @Override
        public List<String> getPaymentControlPluginNames() {
            return ImmutableList.of(TEST_PAYMENT_WITH_CONTROL);
        }
    };
    properties.add(new PluginProperty("name", TEST_PAYMENT_WITH_CONTROL, false));
}
Also used : PluginProperty(org.killbill.billing.payment.api.PluginProperty) OSGIServiceDescriptor(org.killbill.billing.osgi.api.OSGIServiceDescriptor) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) PaymentOptions(org.killbill.billing.payment.api.PaymentOptions) 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