aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authordglFromAtt <dgl@research.att.com>2019-01-07 15:58:44 -0500
committerdglFromAtt <dgl@research.att.com>2019-01-07 16:32:39 -0500
commit2941d6a78d2eec8c6fb87d44e14f512b314e31f0 (patch)
tree76a68e3a83e36ab9efd3449b396599a8415dc29f /src/test
parent536c6aabdfd2bcdc493501a9498fb8a97d208c0b (diff)
Stop referencing unused properties
A few fields for dmaap object were still being set assuming that values came from properties file. Furthermore, a private variable in the DmaapService class was not set to new value from request. Result was that lack of property caused topicNsRoot field to be null, and then the null was used to compose AAF action/instance values incorrectly. Also fixed some test code to initialize properly. Change-Id: Iffabf5728fdfb2f9496c7eb248cb1ed9e1cc1536 Signed-off-by: dglFromAtt <dgl@research.att.com> Issue-ID: DMAAP-933 Signed-off-by: dglFromAtt <dgl@research.att.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/dmaap/dbcapi/resources/DR_SubResourceTest.java34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/test/java/org/onap/dmaap/dbcapi/resources/DR_SubResourceTest.java b/src/test/java/org/onap/dmaap/dbcapi/resources/DR_SubResourceTest.java
index 48d1016..917507f 100644
--- a/src/test/java/org/onap/dmaap/dbcapi/resources/DR_SubResourceTest.java
+++ b/src/test/java/org/onap/dmaap/dbcapi/resources/DR_SubResourceTest.java
@@ -21,6 +21,8 @@
package org.onap.dmaap.dbcapi.resources;
import org.onap.dmaap.dbcapi.model.*;
import org.onap.dmaap.dbcapi.service.*;
+import org.onap.dmaap.dbcapi.testframework.DmaapObjectFactory;
+
import static org.junit.Assert.*;
import org.junit.After;
@@ -39,16 +41,44 @@ import javax.ws.rs.Path;
import javax.ws.rs.GET;
public class DR_SubResourceTest extends JerseyTest{
+
+ static DmaapObjectFactory factory = new DmaapObjectFactory();
@Override
protected Application configure() {
return new ResourceConfig()
.register( DR_SubResource.class )
- .register( FeedResource.class );
+ .register( FeedResource.class )
+ .register( DcaeLocationResource.class )
+ .register( DmaapResource.class );
}
- private static final String fmt = "%24s: %s%n";
String d, un, up, f, p;
+
+ @Before
+ public void preTest() throws Exception {
+ try {
+
+ Dmaap dmaap = factory.genDmaap();
+ Entity<Dmaap> reqEntity = Entity.entity( dmaap, MediaType.APPLICATION_JSON );
+ Response resp = target( "dmaap").request().post( reqEntity, Response.class );
+ System.out.println( resp.getStatus() );
+ assertTrue( resp.getStatus() == 200 );
+ }catch (Exception e ) {
+ }
+ try {
+ DcaeLocation loc = factory.genDcaeLocation( "central" );
+ Entity<DcaeLocation> reqEntity = Entity.entity( loc, MediaType.APPLICATION_JSON );
+ Response resp = target( "dcaeLocations").request().post( reqEntity, Response.class );
+ System.out.println( "POST dcaeLocation resp=" + resp.getStatus() + " " + resp.readEntity( String.class ));
+ if ( resp.getStatus() != 409 ) {
+ assertTrue( resp.getStatus() == 201 );
+ }
+ } catch (Exception e ) {
+ }
+
+
+ }
/*
@Before
public void setUp() throws Exception {