@Test public void set_A$String$int$Object_NullValue() throws Exception { MemcachedSessionStore store = new MemcachedSessionStore(getMemcached()); // given String key = "MemcachedSessionStoreTest#set_A$String$int$Object_NullValue_" + System.currentTimeMillis(); int expire = 100; String value = "aaa"; // when store.set(key, expire, value); store.set(key, expire, null); String actual = store.get(key); // then assertThat(actual, is(nullValue())); }
@Test public void remove_A$String() throws Exception { MemcachedSessionStore store = new MemcachedSessionStore(getMemcached()); // given String key = "MemcachedSessionStoreTest#remove_A$String_" + System.currentTimeMillis(); // when store.set(key, 60, "aaa"); store.remove(key); String actual = store.get(key); // then assertThat(actual, is(nullValue())); }
@Test public void get_A$String() throws Exception { MemcachedSessionStore store = new MemcachedSessionStore(getMemcached()); // given String key = "MemcachedSessionStoreTest#get_A$String_" + System.currentTimeMillis(); String value = "cached" + System.currentTimeMillis(); store.set(key, 60, value); // when String actual = store.get(key); // then assertThat(actual, is(equalTo(value))); }