diff options
author | econwar <conor.ward@est.tech> | 2019-02-14 09:37:44 +0000 |
---|---|---|
committer | econwar <conor.ward@est.tech> | 2019-02-14 09:37:44 +0000 |
commit | c50374709585766e887f349a139de0a6595c1ca1 (patch) | |
tree | fe428b922da00abfabaafffdc72596c582625906 /datarouter-prov/src/test/java | |
parent | 953dbd55595d28ecc7b65413b0edf910da6f45c0 (diff) |
Add optional API for PM Mapper
Added new field to Subscriber class to keep files after published
Added new Delete endpoint so that file can then be deleted
Change-Id: Id72da67689a7ceda8ddd4997cd6349b981cb1cdb
Issue-ID: DMAAP-981
Signed-off-by: econwar <conor.ward@est.tech>
Diffstat (limited to 'datarouter-prov/src/test/java')
2 files changed, 7 insertions, 5 deletions
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServletTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServletTest.java index fd1e68ef..43973d56 100755 --- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServletTest.java +++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/SubscriptionServletTest.java @@ -22,7 +22,6 @@ ******************************************************************************/ package org.onap.dmaap.datarouter.provisioning; -import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; import org.apache.commons.lang3.reflect.FieldUtils; @@ -39,7 +38,6 @@ import org.onap.dmaap.datarouter.provisioning.beans.Subscription; import org.onap.dmaap.datarouter.provisioning.beans.Updateable; import org.onap.dmaap.datarouter.provisioning.utils.DB; import org.powermock.modules.junit4.PowerMockRunner; -import org.slf4j.LoggerFactory; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; @@ -48,15 +46,12 @@ import javax.servlet.ServletInputStream; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.File; import java.io.FileNotFoundException; -import java.io.PrintWriter; import java.sql.SQLException; import java.util.HashSet; import java.util.Set; import static org.hamcrest.Matchers.notNullValue; -import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.*; import static org.onap.dmaap.datarouter.provisioning.BaseServlet.BEHALF_HEADER; @@ -283,6 +278,7 @@ public class SubscriptionServletTest extends DrServletTestBase { jo.put("version", "2.0"); jo.put("metadataOnly", true); jo.put("suspend", true); + jo.put("privilegedSubscriber", true); jo.put("delivery", JSObject); jo.put("subscriber", "differentSubscriber"); jo.put("sync", true); @@ -305,6 +301,7 @@ public class SubscriptionServletTest extends DrServletTestBase { jo.put("version", "2.0"); jo.put("metadataOnly", true); jo.put("suspend", true); + jo.put("privilegedSubscriber", true); jo.put("delivery", JSObject); jo.put("sync", true); return jo; @@ -333,6 +330,7 @@ public class SubscriptionServletTest extends DrServletTestBase { jo.put("version", "2.0"); jo.put("metadataOnly", true); jo.put("suspend", true); + jo.put("privilegedSubscriber", true); jo.put("delivery", JSObject); jo.put("sync", true); jo.put("changeowner", true); @@ -505,6 +503,7 @@ public class SubscriptionServletTest extends DrServletTestBase { subscription.setGroupid(1); subscription.setMetadataOnly(false); subscription.setSuspended(false); + subscription.setPrivilegedSubscriber(false); subscription.doInsert(db.getConnection()); } @@ -518,6 +517,7 @@ public class SubscriptionServletTest extends DrServletTestBase { subscription.setGroupid(1); subscription.setMetadataOnly(false); subscription.setSuspended(false); + subscription.setPrivilegedSubscriber(false); subscription.changeOwnerShip(); subscription.doUpdate(db.getConnection()); } diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/SubscriptionTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/SubscriptionTest.java index 1e0c042b..3e6aed07 100644 --- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/SubscriptionTest.java +++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/SubscriptionTest.java @@ -62,6 +62,7 @@ public class SubscriptionTest { subscription.setMetadataOnly(false); subscription.setSubscriber(subscriber); subscription.setSuspended(false); + subscription.setPrivilegedSubscriber(false); subscription.setLinks(subLinks); Assert.assertEquals(2, subscription.getGroupid()); @@ -69,5 +70,6 @@ public class SubscriptionTest { Assert.assertEquals(subLinks, subscription.getLinks()); Assert.assertFalse(subscription.isMetadataOnly()); Assert.assertFalse(subscription.isSuspended()); + Assert.assertFalse(subscription.isPrivilegedSubscriber()); } }
\ No newline at end of file |