bajapro/online-compiler/java_files/lowertandanonsistematissteeming_gmail_com/JUnitNewsFeedTest.java
2025-06-07 16:18:13 +07:00

33 lines
828 B
Java

package lowertandanonsistematissteeming_gmail_com;
import static org.junit.Assert.assertEquals;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class JUnitNewsFeedTest {
private final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
private final PrintStream oPrintStream = System.out;
@Before
public void setUpStream() {
System.setOut(new PrintStream(outputStream));
}
@After
public void restoreStream() {
System.setOut(oPrintStream);
}
@Test
public void isNewsFeed() {
lowertandanonsistematissteeming_gmail_com.NewsFeed.main(null);
assertEquals("Topic not same", "[Opinion, Tech, Science, Health]", outputStream.toString());
}
}