diff options
author | Joss Armstrong <joss.armstrong@ericsson.com> | 2019-02-12 20:07:10 +0000 |
---|---|---|
committer | Takamune Cho <takamune.cho@att.com> | 2019-02-14 14:22:55 +0000 |
commit | 28ebd9cb512f41600eed2beeb0f6df31fedf19d7 (patch) | |
tree | 5b6090315bbac6edca45bcf2581049172708426c /appc-adapters/appc-dmaap-adapter/appc-message-adapter-factory/src/test | |
parent | 0261ed402d8b1cca0b73024fac24688ca6d81e21 (diff) |
Test coverage DmaapMessageAdapterFactoryActivator
Increased coverage from 0% to 100%
Issue-ID: APPC-1422
Change-Id: I246ddffe3d84682ddb37ca5e94abd0c7f5c7c312
Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
Diffstat (limited to 'appc-adapters/appc-dmaap-adapter/appc-message-adapter-factory/src/test')
-rw-r--r-- | appc-adapters/appc-dmaap-adapter/appc-message-adapter-factory/src/test/java/org/onap/appc/adapter/factory/DmaapMessageAdapterFactoryActivatorTest.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/appc-adapters/appc-dmaap-adapter/appc-message-adapter-factory/src/test/java/org/onap/appc/adapter/factory/DmaapMessageAdapterFactoryActivatorTest.java b/appc-adapters/appc-dmaap-adapter/appc-message-adapter-factory/src/test/java/org/onap/appc/adapter/factory/DmaapMessageAdapterFactoryActivatorTest.java new file mode 100644 index 000000000..3a75f2d2d --- /dev/null +++ b/appc-adapters/appc-dmaap-adapter/appc-message-adapter-factory/src/test/java/org/onap/appc/adapter/factory/DmaapMessageAdapterFactoryActivatorTest.java @@ -0,0 +1,49 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : APPC + * ================================================================================ + * Copyright (C) 2019 Ericsson + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END========================================================= + */ + +package org.onap.appc.adapter.factory; + +import org.junit.Test; +import org.mockito.Mockito; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; +import org.powermock.reflect.Whitebox; + + +public class DmaapMessageAdapterFactoryActivatorTest { + + @Test + public void testStart() throws Exception { + DmaapMessageAdapterFactoryActivator activator = new DmaapMessageAdapterFactoryActivator(); + BundleContext context = Mockito.mock(BundleContext.class); + activator.start(context); + Mockito.verify(context).registerService(Mockito.anyString(), Mockito.any(), Mockito.any()); + } + + @Test + public void testStop() throws Exception { + DmaapMessageAdapterFactoryActivator activator = new DmaapMessageAdapterFactoryActivator(); + ServiceRegistration registration = Mockito.mock(ServiceRegistration.class); + Whitebox.setInternalState(activator, "registration", registration); + activator.stop(Mockito.mock(BundleContext.class)); + Mockito.verify(registration).unregister(); + } +} |