X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Factions%2Ftest%2FJU_Email.java;h=70cd08a8e0dda02a2c2c7eb49b97d1fe9a9bf0bc;hb=3c15cc2c764a240ccd91d07be2d8ec25f4d05392;hp=0779a33d982237055ea34f7aab635d28a60eebbd;hpb=ee51fce2672cd41a0c9ec630365e0b9fd62f22b6;p=aaf%2Fauthz.git 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 0779a33d..70cd08a8 100644 --- 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 java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.PrintStream; import java.util.Collection; @@ -47,12 +48,21 @@ import org.junit.Test; public class JU_Email { + private ByteArrayOutputStream outStream; + private ByteArrayOutputStream errStream; Email email; Identity usersI; Message msg; + PrintStream ps; @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(); @@ -124,7 +134,6 @@ public class JU_Email { @Test public void testLog() throws FileNotFoundException { - PrintStream ps = new PrintStream("test"); 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"); } + + @After + public void cleanUp() { + System.setErr(System.err); + System.setOut(System.out); + } }