@Test public void addStringIntObject() throws TimeoutException, CacheException { EasyMock.expect(client.add("test", 1000, "value")).andReturn(getFuture(true)); EasyMock.replay(client); assertTrue(clientWrapper.add("test", 1000, "value")); EasyMock.verify(client); }
@Test @SuppressWarnings("unchecked") public void addStringIntTMemcacheTranscoderOfT() throws TimeoutException, CacheException { CacheTranscoder transcoder = EasyMock.createMock(CacheTranscoder.class); EasyMock.expect( client.add( EasyMock.eq("test"), EasyMock.eq(1000), EasyMock.eq("value"), EasyMock.anyObject(Transcoder.class))) .andReturn(getFuture(true)); EasyMock.replay(client, transcoder); assertTrue(clientWrapper.add("test", 1000, "value", transcoder)); EasyMock.verify(client, transcoder); }