package de.steamwar.command; import org.hamcrest.Matchers; import org.junit.Test; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; public class CacheCommandTest { @Test public void testCaching() { CacheCommand cmd = new CacheCommand(); List tabCompletions1 = cmd.tabComplete("test", "", new String[]{""}); List tabCompletions2 = cmd.tabComplete("test", "", new String[]{""}); assertThat(tabCompletions1, is(equalTo(tabCompletions2))); } @Test public void testCachingWithDifferentSenders() { CacheCommand cmd = new CacheCommand(); List tabCompletions1 = cmd.tabComplete("test", "", new String[]{""}); List tabCompletions2 = cmd.tabComplete("test2", "", new String[]{""}); assertThat(tabCompletions1, is(not(equalTo(tabCompletions2)))); } }