Beispiel #1
0
 public void testDocumentRemoved() {
   mock.documentAdded("document");
   EasyMock.expect(mock.voteForRemoval("document")).andReturn((byte) 42);
   mock.documentRemoved("document");
   control.replay();
   classUnderTest.addDocument("document", new byte[0]);
   assertTrue(classUnderTest.removeDocument("document"));
 }
Beispiel #2
0
 public void testVoteForRemoval() {
   mock.documentAdded("Document"); // expect document addition
   // expect to be asked to vote for document removal, and vote for it
   EasyMock.expect(mock.voteForRemoval("Document")).andReturn((byte) 42);
   mock.documentRemoved("Document"); // expect document removal
   EasyMock.replay(mock);
   classUnderTest.addDocument("Document", new byte[0]);
   assertTrue(classUnderTest.removeDocument("Document"));
   EasyMock.verify(mock);
 }