diff options
author | dglFromAtt <dgl@research.att.com> | 2018-10-23 17:15:14 -0400 |
---|---|---|
committer | dglFromAtt <dgl@research.att.com> | 2018-10-23 17:15:19 -0400 |
commit | b16582c9734a3a01eb99ecbde508a13c396a284a (patch) | |
tree | 7c946c6883f0c10867e799c8a7e432a4a7763a7a /src | |
parent | 1e27211fbd0ef1718028cb3ce9248592aec0e136 (diff) |
Address CLM violations
Change-Id: Id7afff65de1a4c32c95da8ea359d7f97b025cf63
Signed-off-by: dglFromAtt <dgl@research.att.com>
Issue-ID: DMAAP-656
Diffstat (limited to 'src')
-rw-r--r-- | src/test/java/org/onap/dmaap/dbcapi/resources/TopicResourceTest.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/test/java/org/onap/dmaap/dbcapi/resources/TopicResourceTest.java b/src/test/java/org/onap/dmaap/dbcapi/resources/TopicResourceTest.java index 43cf523..b494a59 100644 --- a/src/test/java/org/onap/dmaap/dbcapi/resources/TopicResourceTest.java +++ b/src/test/java/org/onap/dmaap/dbcapi/resources/TopicResourceTest.java @@ -31,6 +31,7 @@ import org.glassfish.jersey.test.JerseyTest; import org.junit.Before; import org.junit.Test; import org.onap.dmaap.dbcapi.model.DcaeLocation; +import org.onap.dmaap.dbcapi.model.Dmaap; import org.onap.dmaap.dbcapi.model.MR_Cluster; import org.onap.dmaap.dbcapi.model.Topic; import org.onap.dmaap.dbcapi.testframework.DmaapObjectFactory; @@ -46,7 +47,8 @@ public class TopicResourceTest extends JerseyTest { return new ResourceConfig() .register( TopicResource.class ) .register( MR_ClusterResource.class ) - .register( DcaeLocationResource.class ); + .register( DcaeLocationResource.class ) + .register( DmaapResource.class ); } private static final String fmt = "%24s: %s%n"; @@ -57,6 +59,15 @@ public class TopicResourceTest extends JerseyTest { @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 ); @@ -72,7 +83,7 @@ public class TopicResourceTest extends JerseyTest { Response resp = target( "mr_clusters").request().post( reqEntity, Response.class ); System.out.println( "POST MR_Cluster resp=" + resp.getStatus() + " " + resp.readEntity( String.class ) ); if (resp.getStatus() != 409 ) { - assertTrue( resp.getStatus() == 200); + assertTrue( resp.getStatus() == 201); } } catch (Exception e ) { @@ -93,6 +104,8 @@ public class TopicResourceTest extends JerseyTest { assertTrue( resp.getStatus() == 200 ); } + + @Test public void PostTest() { Topic topic = factory.genSimpleTopic( "test1" ); @@ -110,6 +123,7 @@ public class TopicResourceTest extends JerseyTest { } + @Test public void PutTest() { |