diff options
author | Tait,Trevor(rt0435) <rtait@amdocs.com> | 2019-01-10 16:40:32 -0500 |
---|---|---|
committer | Tait,Trevor(rt0435) <rtait@amdocs.com> | 2019-01-10 16:56:45 -0500 |
commit | c44a035ed8222c2b39bd0fd522b952fac61f9a36 (patch) | |
tree | 2f35316a9d892b8f73f1b2b655deb3b48fe8ae06 /src/test/java/org/onap/pomba/contextaggregator/service/ContextAggregatorProcessorTest.java | |
parent | 011ac9cfcfd1d5aba077feffb0edbb25818e4ea0 (diff) |
Context Aggregator L2 Fabric
Upgraded the Context Aggregator to use the latest pomba-audit-common
model.
Also cleaned up a lot of whitespace and import order errors that were
being output by the ONAP audit.
Issue-ID: LOG-920
Change-Id: I0a7e15f19f28775bbd3e9cf4e95c4de176545ae1
Signed-off-by: Tait,Trevor(rt0435) <rtait@amdocs.com>
Diffstat (limited to 'src/test/java/org/onap/pomba/contextaggregator/service/ContextAggregatorProcessorTest.java')
-rw-r--r-- | src/test/java/org/onap/pomba/contextaggregator/service/ContextAggregatorProcessorTest.java | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/src/test/java/org/onap/pomba/contextaggregator/service/ContextAggregatorProcessorTest.java b/src/test/java/org/onap/pomba/contextaggregator/service/ContextAggregatorProcessorTest.java index 4624e40..084bce0 100644 --- a/src/test/java/org/onap/pomba/contextaggregator/service/ContextAggregatorProcessorTest.java +++ b/src/test/java/org/onap/pomba/contextaggregator/service/ContextAggregatorProcessorTest.java @@ -15,9 +15,14 @@ * limitations under the License. * ============LICENSE_END===================================================== */ + package org.onap.pomba.contextaggregator.service; +import static org.mockito.Mockito.when; + import com.att.nsa.mr.client.MRConsumer; +import java.util.List; +import java.util.concurrent.ExecutorService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,16 +37,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import java.util.List; -import java.util.concurrent.ExecutorService; - -import static org.mockito.Mockito.*; - @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest @ConfigurationProperties("classpath:/src/test/resources/GoodProperties/sdnc.properties") -public class ContextAggregatorProcessorTest -{ +public class ContextAggregatorProcessorTest { + @Mock Logger log; @Mock @@ -60,25 +60,23 @@ public class ContextAggregatorProcessorTest @InjectMocks ContextAggregatorProcessor contextAggregatorProcessor; - private String payload = "{" + - " \"serviceInstanceId\"" + ": " + "\"8ea56b0d-459d-4668-b363-c9567432d8b7\"" + "," + - " \"modelVersionId\"" + ": " + "\"4e3d28cf-d654-41af-a47b-04b4bd0ac58e\"" + "," + - " \"modelInvariantId\"" + ": " + "\"74bc1518-282d-4148-860f-8892b6369456\"" + "," + - " \"customerId\"" + ": " + "\"junit\"" + "," + - " \"serviceType\"" + ": " + "\"vFWCL\"" + "," + - " \"xFromAppId\"" + ": " + "\"POMBA\"" + "," + - " \"xTransactionId\"" + ": " + "\"8a9ddb25-2e79-449c-a40d-5011bac0da39\"" + - "}"; + private String payload = "{" + + " \"serviceInstanceId\"" + ": " + "\"8ea56b0d-459d-4668-b363-c9567432d8b7\"," + + " \"modelVersionId\"" + ": " + "\"4e3d28cf-d654-41af-a47b-04b4bd0ac58e\"," + + " \"modelInvariantId\"" + ": " + "\"74bc1518-282d-4148-860f-8892b6369456\"," + + " \"customerId\"" + ": " + "\"junit\"," + + " \"serviceType\"" + ": " + "\"vFWCL\"," + + " \"xFromAppId\"" + ": " + "\"POMBA\"," + + " \"xTransactionId\"" + ": " + "\"8a9ddb25-2e79-449c-a40d-5011bac0da39\"," + + "}"; @Before - public void setUp() - { + public void setUp() { MockitoAnnotations.initMocks(this); } @Test - public void testProcessNullPublisherInvalidPayload() throws Exception - { + public void testProcessNullPublisherInvalidPayload() throws Exception { when(publisherFactory.getPartition()) .thenReturn("getPartitionResponse"); when(publisherFactory.getRetries()).thenReturn(0); @@ -96,14 +94,13 @@ public class ContextAggregatorProcessorTest try { contextAggregatorProcessor.process(""); } - catch (Exception e){ + catch (Exception e) { // expected } } @Test - public void testProcessNullPublisherValidPayload() throws Exception - { + public void testProcessNullPublisherValidPayload() throws Exception { when(publisherFactory.getPartition()) .thenReturn("getPartitionResponse"); when(publisherFactory.getRetries()).thenReturn(0); |