X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Fclient%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Fclient%2Ftest%2FJU_AbsAuthentication.java;h=9c293c924c498c300abe68b3dd1c3241c02fa8f8;hb=refs%2Fchanges%2F24%2F97124%2F3;hp=65daa7b6269234fed5646d4c5972fef96c03ec6f;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9;p=aaf%2Fauthz.git diff --git a/cadi/client/src/test/java/org/onap/aaf/cadi/client/test/JU_AbsAuthentication.java b/cadi/client/src/test/java/org/onap/aaf/cadi/client/test/JU_AbsAuthentication.java index 65daa7b6..9c293c92 100644 --- a/cadi/client/src/test/java/org/onap/aaf/cadi/client/test/JU_AbsAuthentication.java +++ b/cadi/client/src/test/java/org/onap/aaf/cadi/client/test/JU_AbsAuthentication.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -34,20 +34,20 @@ import java.io.PrintStream; import java.net.HttpURLConnection; public class JU_AbsAuthentication { - + private final static String ID = "id"; private final static String PASSWORD = "password"; private final static String WARNING = "Your service has 1000 consecutive bad service " + "logins to AAF. AAF Access will be disabled after 10000\n"; - + private static ByteArrayOutputStream errStream; - + @Before public void setup() { errStream = new ByteArrayOutputStream(); System.setErr(new PrintStream(errStream)); } - + @After public void tearDown() { System.setErr(System.err); @@ -59,7 +59,7 @@ public class JU_AbsAuthentication { assertThat(stub.getID(), is(nullValue())); assertThat(stub.headValue(), is("")); assertThat(stub.count(), is(0)); - + stub.setUser(ID); assertThat(stub.getID(), is(ID)); @@ -67,7 +67,7 @@ public class JU_AbsAuthentication { assertThat(stub.getID(), is(ID)); assertThat(stub.headValue(), is(PASSWORD)); assertThat(stub.count(), is(0)); - + assertThat(stub.setLastResponse(200), is(0)); assertThat(stub.isDenied(), is(false)); @@ -81,12 +81,12 @@ public class JU_AbsAuthentication { stub.setCount(999); assertThat(stub.setLastResponse(401), is(1000)); assertThat(errStream.toString(), is(WARNING)); - + // coverage... stub.setLastMiss(1); assertThat(stub.isDenied(), is(false)); } - + private class AuthStub extends AbsAuthentication { public AuthStub(SecurityInfoC securityInfo, String user, byte[] headValue) @@ -95,7 +95,7 @@ public class JU_AbsAuthentication { @Override public void setSecurity(HttpURLConnection client) throws CadiException { } @Override public void setUser(String id) { super.setUser(id); } @Override public String headValue() throws IOException { return super.headValue(); } - + public void setLastMiss(long lastMiss) { this.lastMiss = lastMiss; } public void setCount(int count) { this.count = count; } }