aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-prov/src/test
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2019-08-08 10:55:33 +0000
committerefiacor <fiachra.corcoran@est.tech>2019-08-08 10:55:33 +0000
commit6c78b3e6a0a67c73f931337356a172cc69cee0e8 (patch)
tree3d12ade7a92541e0332c6dc75e6f9522c65a1917 /datarouter-prov/src/test
parentbc1df610cddfb558cf6bde90c269b4af59768648 (diff)
Removing code smells
Change-Id: I3774ac6d2e3f30d00b6f2d540a036c9c22a9ceb2 Issue-ID: DMAAP-1195 Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Diffstat (limited to 'datarouter-prov/src/test')
-rw-r--r--datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRouteTest.java12
-rw-r--r--datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecordTest.java4
-rw-r--r--datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/FeedTest.java4
-rw-r--r--datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRouteTest.java8
-rw-r--r--datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilterTest.java2
5 files changed, 7 insertions, 23 deletions
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRouteTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRouteTest.java
index 7ef52ff8..7b77a1ea 100644
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRouteTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/EgressRouteTest.java
@@ -64,15 +64,7 @@ public class EgressRouteTest {
}
@Test
- public void Verify_NetworkRoute_Is_Added_Successfully() throws SQLException {
- Assert.assertEquals(1, EgressRoute.getAllEgressRoutes().size());
- egressRoute.doInsert(db.getConnection());
- Assert.assertEquals(2, EgressRoute.getAllEgressRoutes().size());
- egressRoute.doDelete(db.getConnection());
- }
-
- @Test
- public void Verify_NetworkRoute_Is_Removed_Successfully() throws SQLException {
+ public void Verify_EgressRoute_Is_Removed_Successfully() throws SQLException {
Assert.assertEquals(1, EgressRoute.getAllEgressRoutes().size());
EgressRoute egressRoute = new EgressRoute(1, 1);
egressRoute.doDelete(db.getConnection());
@@ -80,7 +72,7 @@ public class EgressRouteTest {
}
@Test
- public void Verify_NetworkRoute_Is_Updated_Successfully() throws SQLException {
+ public void Verify_EgressRoute_Is_Updated_Successfully() throws SQLException {
EgressRoute egressRoute = new EgressRoute(1, 1);
EgressRoute egressRoute1 = new EgressRoute(1, 1);
Assert.assertEquals(egressRoute.hashCode(), egressRoute1.hashCode());
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecordTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecordTest.java
index 34a6d979..1bf34e40 100644
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecordTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/ExpiryRecordTest.java
@@ -46,7 +46,7 @@ public class ExpiryRecordTest {
Assert.assertEquals(2000, expiryRecord.getContentLength());
Assert.assertEquals(285, expiryRecord.getSubid());
Assert.assertEquals("file.txt", expiryRecord.getFileid());
- Assert.assertEquals(100, expiryRecord.getAttempts());
+ Assert.assertEquals(100, expiryRecord.getDeliveryAttempts());
Assert.assertEquals("other", expiryRecord.getReason());
}
@@ -63,7 +63,7 @@ public class ExpiryRecordTest {
expiryRecord.setMethod("PUT");
expiryRecord.setSubid(322);
expiryRecord.setFileid("file.txt");
- expiryRecord.setAttempts(125);
+ expiryRecord.setDeliveryAttempts(125);
expiryRecord.setReason("Out of memory");
LOGJSONObject expiryRecordJson = createBaseLogRecordJson();
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/FeedTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/FeedTest.java
index dcab5410..9db43223 100644
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/FeedTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/FeedTest.java
@@ -140,8 +140,8 @@ public class FeedTest {
setA.add(new FeedEndpointID("1", "Name"));
Set setB = new HashSet();
setB.add("172.0.0.1");
- fa.setEndpoint_ids(setA);
- fa.setEndpoint_addrs(setB);
+ fa.setEndpointIDS(setA);
+ fa.setEndpointAddrs(setB);
feed.setAuthorization(fa);
Assert.assertEquals(feed.doInsert(connection), false);
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRouteTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRouteTest.java
index df786b55..d727bc77 100644
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRouteTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/beans/NetworkRouteTest.java
@@ -64,14 +64,6 @@ public class NetworkRouteTest {
}
@Test
- public void Verify_NetworkRoute_Is_Added_Successfully() throws SQLException {
- Assert.assertEquals(1, NetworkRoute.getAllNetworkRoutes().size());
- networkRoute.doInsert(db.getConnection());
- Assert.assertEquals(2, NetworkRoute.getAllNetworkRoutes().size());
- networkRoute.doDelete(db.getConnection());
- }
-
- @Test
public void Verify_NetworkRoute_Is_Removed_Successfully() throws SQLException {
Assert.assertEquals(1, NetworkRoute.getAllNetworkRoutes().size());
NetworkRoute networkRoute = new NetworkRoute("stub_from.", "stub_to.");
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilterTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilterTest.java
index a8e919b7..94ef3b72 100644
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilterTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/utils/ThrottleFilterTest.java
@@ -108,7 +108,7 @@ public class ThrottleFilterTest {
List<Continuation> continuation_list = new ArrayList<>();
continuation_list.add(continuation);
suspended_requests.put("null/-1", continuation_list);
- FieldUtils.writeDeclaredField(throttlefilter, "suspended_requests", suspended_requests, true);
+ FieldUtils.writeDeclaredField(throttlefilter, "suspendedRequests", suspended_requests, true);
throttlefilter.doFilter(request, response, filterchain);
verify(continuation, times(1)).setAttribute(anyString(), any());
verify(continuation, times(1)).resume();