コード例 #1
0
 @Before
 public void setUp() {
   control = createControl();
   ab = control.createMock(ArticleBusiness.class);
   st = new ScheduledTasks();
   st.setModerationBatchSize(3);
   st.setArticleBusiness(ab);
 }
コード例 #2
0
  @Test
  public void testModerateCommentsError() throws Exception {
    expect(ab.moderateComments(3)).andThrow(new RuntimeException("test"));
    control.replay();

    st.moderateComments();
    control.verify();
  }
コード例 #3
0
  @Test
  public void testModerateComments() throws Exception {
    expect(ab.moderateComments(3)).andReturn(true);
    expect(ab.moderateComments(3)).andReturn(false);
    control.replay();

    st.moderateComments();
    control.verify();
  }