Beispiel #1
0
  @Test
  public void test2ping() throws InterruptedException {
    long lastActive = store.getSessions().get(0).getLastActive();

    assertThat(store.isValidToken(store.getSessions().get(0).getToken(), false), is(true));

    assertThat(store.getSessions().get(0).getLastActive(), is(lastActive));

    TimeUnit.MILLISECONDS.sleep(100);

    assertThat(store.isValidToken(store.getSessions().get(0).getToken(), true), is(true));

    assertThat(store.getSessions().get(0).getLastActive(), is(greaterThan(lastActive)));
  }
Beispiel #2
0
  @Test
  public void test0init() {
    assertThat(store.getSessions().isEmpty(), is(true));
    assertThat(store.isValidToken("asdf", true), is(false));
    assertThat(store.getIdentityForToken("asdf"), is(nullValue()));

    // These shouldn't throw anything
    store.destroyToken("asdf");
  }