@Test public void shouldLookForCurlyBracketsInJSONBlob() throws TokenStrategyFailedException, UnsupportedEncodingException { Token mockToken = mock(Token.class); given(mockToken.getType()).willReturn(TokenType.SESSION); given(mockToken.getBlob()).willReturn("badger".getBytes(TokenBlobUtils.ENCODING)); compression.perform(mockToken); verify(mockToken, atLeastOnce()).getBlob(); verify(mockToken, times(0)).setBlob(any(byte[].class)); }
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);  }