X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-cmd%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcmd%2Ftest%2Fmgmt%2FJU_Log.java;h=6e6f06edbdaf01ed705304c4e6d662b9db1a386d;hb=32cdd553a8668e6d03a9cf5b11b360d35a63c87f;hp=2441fba2b3d9dd6e970f1cab87828c740655c077;hpb=0d04b7513ab8f5c3bd9967fad9772688113fe437;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java index 2441fba2..6e6f06ed 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java @@ -41,6 +41,7 @@ import org.mockito.runners.MockitoJUnitRunner; import org.onap.aaf.auth.cmd.AAFcli; import org.onap.aaf.auth.cmd.mgmt.Log; import org.onap.aaf.auth.cmd.mgmt.Mgmt; +import org.onap.aaf.auth.common.Define; import org.onap.aaf.auth.env.AuthzEnv; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.Locator; @@ -65,7 +66,7 @@ public class JU_Log { AAFcli aafcli; @Before - public void setUp() throws APIException, LocatorException { + public void setUp() throws APIException, LocatorException, CadiException { prop = new PropAccess(); aEnv = new AuthzEnv(); wtr = mock(Writer.class); @@ -74,27 +75,33 @@ public class JU_Log { hman = new HMangr(aEnv, loc); aafcli = new AAFcli(prop, aEnv, wtr, hman, null, secSet); Mgmt mgmt = new Mgmt(aafcli); - log = mock(Log.class); log1 = new Log(mgmt); } @Test public void testExec() throws APIException, LocatorException, CadiException, URISyntaxException { -// Item value = mock(Item.class); -// Locator.Item item = new Locator.Item() { -// }; -// when(loc.best()).thenReturn(value); -// URI uri = new URI("http://java.sun.com/j2se/1.3/"); -// when(loc.get(value)).thenReturn(uri); -// SecuritySetter secSet = mock(SecuritySetter.class); + Item value = mock(Item.class); + Locator.Item item = new Locator.Item() { + }; + when(loc.best()).thenReturn(value); + URI uri = new URI("http://www.oracle.com/technetwork/java/index.html"); + when(loc.get(value)).thenReturn(uri); + SecuritySetter secSet = mock(SecuritySetter.class); // HRcli hcli = new HRcli(hman, uri, item, secSet); - String[] strArr = {"add","upd","del","add","upd","del"}; - log._exec(0, strArr); - +// when(loc.first()).thenReturn(value); +// String[] strArr = {"add","upd","del","add","upd","del"}; +// log1._exec(0, strArr); +// // String[] strArr1 = {"del","add","upd","del"}; // log1._exec(0, strArr1); -// -// String[] strArr2 = {"add","upd","del","add","upd","del"}; -// log1._exec(0, strArr2); + + } + + @Test + public void testDetailedHelp() throws CadiException { + Define define = new Define(); + define.set(prop); + StringBuilder sb = new StringBuilder(); + log1.detailedHelp(0, sb); } }