SimpleNameSubstitutionStrategy implements NameSubstitutionStrategy { @Override public String deflate(String value) { deflateCalls++; return deflateCache.get(value); } SimpleNameSubstitutionStrategy(); @Override void setup(Map config); @Override String deflate(String value); @Override String inflate(String value); static String wrap(String str); void setSubstitutionList(List<Pair<String, String>> substitutionList); long getDeflateCalls(); long getDeflateCacheMisses(); long getInflateCalls(); long getInflateCacheMisses(); static final String SUBS_DELIM; }
@Test public void testDeflate() { String test = testSubject.deflate(KEY1); assertThat(test, is(SimpleNameSubstitutionStrategy.wrap(VALUE1))); }
@Test public void testNonSubstitutionReturnsOriginalInput() { String test = testSubject.deflate("misspelled tets"); assertThat(test, is("misspelled tets")); }