Code Review
/
aaf
/
authz.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Increased code coverage auth batch
[aaf/authz.git]
/
auth
/
auth-batch
/
src
/
test
/
java
/
org
/
onap
/
aaf
/
auth
/
actions
/
test
/
JU_Email.java
diff --git
a/auth/auth-batch/src/test/java/org/onap/aaf/auth/actions/test/JU_Email.java
b/auth/auth-batch/src/test/java/org/onap/aaf/auth/actions/test/JU_Email.java
index
0779a33
..
70cd08a
100644
(file)
--- a/
auth/auth-batch/src/test/java/org/onap/aaf/auth/actions/test/JU_Email.java
+++ b/
auth/auth-batch/src/test/java/org/onap/aaf/auth/actions/test/JU_Email.java
@@
-37,6
+37,7
@@
import org.onap.aaf.auth.org.OrganizationException;
import static org.mockito.Mockito.*;
import static org.mockito.Mockito.*;
+import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Collection;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Collection;
@@
-47,12
+48,21
@@
import org.junit.Test;
public class JU_Email {
public class JU_Email {
+ private ByteArrayOutputStream outStream;
+ private ByteArrayOutputStream errStream;
Email email;
Identity usersI;
Message msg;
Email email;
Identity usersI;
Message msg;
+ PrintStream ps;
@Before
@Before
- public void setUp() {
+ public void setUp() throws FileNotFoundException {
+ outStream = new ByteArrayOutputStream();
+ errStream = new ByteArrayOutputStream();
+ ps = new PrintStream(errStream);
+ System.setOut(new PrintStream(outStream));
+ System.setErr(ps);
+
usersI = mock(Identity.class);
msg = new Message();
email = new Email();
usersI = mock(Identity.class);
msg = new Message();
email = new Email();
@@
-124,7
+134,6
@@
public class JU_Email {
@Test
public void testLog() throws FileNotFoundException {
@Test
public void testLog() throws FileNotFoundException {
- PrintStream ps = new PrintStream("test");
email.addTo("email");
email.addCC("email");
email.log(ps, "email");
email.addTo("email");
email.addCC("email");
email.log(ps, "email");
@@
-132,5
+141,11
@@
public class JU_Email {
email.addCC("emails");
email.log(ps, "emails");
}
email.addCC("emails");
email.log(ps, "emails");
}
+
+ @After
+ public void cleanUp() {
+ System.setErr(System.err);
+ System.setOut(System.out);
+ }
}
}