@Test public void shouldUseTokenWhenStoringStringAsBlob() throws CoreTokenException { TokenBlobUtils utils = new TokenBlobUtils(); Token mockToken = mock(Token.class); utils.setBlobFromString(mockToken, "badger"); verify(mockToken).setBlob(any(byte[].class)); }
public void setBlobFromString(Token token, String blob) { try { token.setBlob(blob.getBytes(ENCODING)); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode blob to " + ENCODING, e); } }
TokenBlobUtils { public void setBlobFromString(Token token, String blob) { try { token.setBlob(blob.getBytes(ENCODING)); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode blob to " + ENCODING, e); } } }
TokenBlobUtils { public void setBlobFromString(Token token, String blob) { try { token.setBlob(blob.getBytes(ENCODING)); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode blob to " + ENCODING, e); } }  }
TokenBlobUtils { public void setBlobFromString(Token token, String blob) { try { token.setBlob(blob.getBytes(ENCODING)); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode blob to " + ENCODING, e); } }  String getBlobAsString(Token token); void setBlobFromString(Token token, String blob); }
TokenBlobUtils { public void setBlobFromString(Token token, String blob) { try { token.setBlob(blob.getBytes(ENCODING)); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode blob to " + ENCODING, e); } }  String getBlobAsString(Token token); void setBlobFromString(Token token, String blob); static final String ENCODING; }