X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Fcore%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Ftest%2FJU_CmdLine.java;h=52be7d5e6a26d3c8c2f3b97fef88ec29caf67ecc;hb=087706284431e63ea77b934859a47beeb59e4592;hp=5da67ce09148e879f082e6687aad228000511e76;hpb=a20accc73189d8e5454cd26049c0e6fae75da16f;p=aaf%2Fauthz.git diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java index 5da67ce0..52be7d5e 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java @@ -21,12 +21,10 @@ ******************************************************************************/ package org.onap.aaf.cadi.test; -import static org.mockito.Matchers.*; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; import org.junit.*; import org.mockito.*; -import static org.mockito.Mockito.*; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -67,11 +65,11 @@ public class JU_CmdLine { p.setProperty("force_exit", "false"); CmdLine.access = new PropAccess(p); - + keyfile = "src/test/resources/keyfile"; password = "password"; - keyfile = "test/keyfile"; - FileInputStream fis = new FileInputStream(keyfile); + File keyF = new File("src/test/resources", "keyfile"); + FileInputStream fis = new FileInputStream(keyF); try { symm = Symm.obtain(fis); } finally { @@ -97,12 +95,12 @@ public class JU_CmdLine { assertThat(decrypted, is(password)); } - @Test - public void regurgitateTest() { - // TODO: We may still want to remove the regurgitate functionality - // from the CmdLine - Ian - fail("Tests not yet implemented"); - } + // @Test + // public void regurgitateTest() { + // // TODO: We may still want to remove the regurgitate functionality + // // from the CmdLine - Ian + // fail("Tests not yet implemented"); + // } @Test public void encode64Test() throws Exception { @@ -165,6 +163,10 @@ public class JU_CmdLine { assertThat(outContent.toString().length(), is(2074)); String filePath = "test/output_key"; + File testDir = new File("test"); + if(!testDir.exists()) { + testDir.mkdirs(); + } CmdLine.main(new String[]{"keygen", filePath}); File keyfile = new File(filePath); assertTrue(Files.isReadable(Paths.get(filePath)));