@Test public void shouldCompressSessionBlob() throws TokenStrategyFailedException, UnsupportedEncodingException { Token token = new Token("Badger", TokenType.SESSION); String blob = "{\"sessionID\":badger}"; token.setBlob(blob.getBytes(TokenBlobUtils.ENCODING)); compression.perform(token); int previous = blob.getBytes().length; int updated = token.getBlob().length; assertTrue(updated < previous); }
public void perform(Token token) throws TokenStrategyFailedException { if (!isTokenValidForCompression(token)) { return; } performUpdate(token, replacement); }
AttributeCompressionStrategy implements BlobStrategy { public void perform(Token token) throws TokenStrategyFailedException { if (!isTokenValidForCompression(token)) { return; } performUpdate(token, replacement); } }
AttributeCompressionStrategy implements BlobStrategy { public void perform(Token token) throws TokenStrategyFailedException { if (!isTokenValidForCompression(token)) { return; } performUpdate(token, replacement); } @Inject  AttributeCompressionStrategy(TokenBlobUtils blobUtils); }
AttributeCompressionStrategy implements BlobStrategy { public void perform(Token token) throws TokenStrategyFailedException { if (!isTokenValidForCompression(token)) { return; } performUpdate(token, replacement); } @Inject  AttributeCompressionStrategy(TokenBlobUtils blobUtils); void perform(Token token); void reverse(Token token); static String getInitials(String name); static Collection<Field> getAllValidFields(Class c); }
AttributeCompressionStrategy implements BlobStrategy { public void perform(Token token) throws TokenStrategyFailedException { if (!isTokenValidForCompression(token)) { return; } performUpdate(token, replacement); } @Inject  AttributeCompressionStrategy(TokenBlobUtils blobUtils); void perform(Token token); void reverse(Token token); static String getInitials(String name); static Collection<Field> getAllValidFields(Class c);  }