Esempio n. 1
0
 @Test
 public void testFlush() {
   TamedEnderman e = factory.getNewOne("main()");
   factory.flush();
   verify(database).save(e.getDatabaseEntity());
   verifyNoMoreInteractions(database);
 }
Esempio n. 2
0
  @Test
  public void testStorage() {
    TamedEnderman e = factory.getNewOne("main()");
    OfflinePlayer someOtherPlayer = mock(OfflinePlayer.class);
    when(someOtherPlayer.getName()).thenReturn("not main()");

    e.setOwner(someOtherPlayer);
    factory.save(e);
    Collection<TamedEnderman> main = factory.getAll("main()");
    Collection<TamedEnderman> notmain = factory.getAll("not main()");

    assertTrue(main.isEmpty());
    assertFalse(notmain.isEmpty());

    assertTrue(notmain.contains(e));
    assertEquals(1, notmain.size());
  }