@Test public void testClear() throws PersistenceException { QueryArgumentMatcher<Void, Context> queryArgumentMatcher = QueryArgumentMatcher.valueOf(ClearQuery.class); EasyMock.expect(this.dataStoreMock.execute(queryArgumentMatcher.match())).andReturn(null); EasyMock.replay(this.dataStoreMock); this.objectStore.clear(); EasyMock.verify(this.dataStoreMock); }
@Test public void testSize() throws PersistenceException { QueryArgumentMatcher<Long, Context> queryArgumentMatcher = QueryArgumentMatcher.valueOf(SizeQuery.class); long expected = 1; EasyMock.expect(this.dataStoreMock.execute(queryArgumentMatcher.match())) .andReturn(Long.valueOf(expected)); EasyMock.replay(this.dataStoreMock); Assert.assertEquals(expected, this.objectStore.size()); EasyMock.verify(this.dataStoreMock); }