View Javadoc

1   package com.atlassian.johnson.event;
2   
3   import java.io.PrintStream;
4   
5   import org.junit.Test;
6   
7   import static org.easymock.EasyMock.createStrictMock;
8   import static org.junit.Assert.*;
9   
10  public class EventTest
11  {
12      @Test
13      public void testToStringDoesntSysout() throws Exception
14      {
15          PrintStream realOut = System.out;
16          
17          PrintStream mockOut = createStrictMock(PrintStream.class);
18          System.setOut(mockOut);
19          try
20          {
21              Event event = new Event(new EventType("foo", "bar"), "fubar");
22              assertNotNull(event.toString());
23          }
24          finally
25          {
26              System.setOut(realOut);
27          }
28      }
29  }