PlainTextSegment implements Segment { @Override public boolean validateToken(final String token) { return text.equals(token); } PlainTextSegment(final String text); @Override String getStaticText(); @Override boolean validateToken(final String token); @Override String createToken(final String prefix, final Timestamp timestamp);  }
@Test public void validateValidToken() { PlainTextSegment segment = new PlainTextSegment("test"); assertThat(segment.validateToken("test")).isTrue(); }
@Test public void validateInvalidToken() { PlainTextSegment segment = new PlainTextSegment("test"); assertThat(segment.validateToken("Hello World!")).isFalse(); }