@Test public void testModerateCommentsError() throws Exception { expect(ab.moderateComments(3)).andThrow(new RuntimeException("test")); control.replay(); st.moderateComments(); control.verify(); }
@Test public void testModerateComments() throws Exception { expect(ab.moderateComments(3)).andReturn(true); expect(ab.moderateComments(3)).andReturn(false); control.replay(); st.moderateComments(); control.verify(); }