summaryrefslogtreecommitdiffstats
path: root/datarouter-node/src/test
diff options
context:
space:
mode:
authoreconwar <conor.ward@est.tech>2019-05-08 12:06:50 +0000
committereconwar <conor.ward@est.tech>2019-05-08 12:06:50 +0000
commit5e6a9f65049e8e8d39e8dcab227e5d75b328b173 (patch)
tree229531612f9d67b726b65079872c1af7c4adb8a1 /datarouter-node/src/test
parentbb01feceff0527c8f63ad513d85975e5c4e2e52f (diff)
Remove datarouter-node critical code smells
Change-Id: Iff0f9e2c4f326e75ee4bb5c8328c3a341468cf1b Issue-ID: DMAAP-1195 Signed-off-by: econwar <conor.ward@est.tech>
Diffstat (limited to 'datarouter-node/src/test')
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java
index 6dc334fc..fa868b26 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryQueueTest.java
@@ -45,20 +45,18 @@ public class DeliveryQueueTest {
DeliveryQueueHelper deliveryQueueHelper;
private String dirPath = "/tmp/dir001/";
- private String FileName1 = "10000000000004.fileName.M";
+ private String fileName = "10000000000004.fileName.M";
@Before
public void setUp() {
- when(destInfo.getSpool()).thenReturn("tmp");
+ when(destInfo.getSpool()).thenReturn(dirPath);
deliveryQueue = new DeliveryQueue(deliveryQueueHelper, destInfo);
}
@Test
public void Given_New_DeliveryQueue_Directory_Is_Created_As_Defined_By_DestInfo() {
- when(destInfo.getSpool()).thenReturn("tmp");
- File file = new File("tmp");
+ File file = new File("/tmp");
assertTrue(file.exists());
- deleteFile("tmp");
}
@Test
@@ -75,7 +73,7 @@ public class DeliveryQueueTest {
deliveryQueue = new DeliveryQueue(deliveryQueueHelper, destInfo);
DeliveryTask nt = deliveryQueue.getNext();
assertEquals("10000000000004.fileName", nt.getPublishId());
- deleteFile(dirPath + FileName1);
+ deleteFile(dirPath + fileName);
deleteFile(dirPath);
}
@@ -87,9 +85,7 @@ public class DeliveryQueueTest {
private void prepareFiles() throws Exception {
createFolder(dirPath);
- createFile(FileName1, dirPath);
- String[] files = new String[2];
- files[0] = dirPath + FileName1;
+ createFile(fileName, dirPath);
}
private void createFolder(String dirName) {