@Test public void shouldUseTokenForBlobAsString() throws CoreTokenException, UnsupportedEncodingException { TokenBlobUtils utils = new TokenBlobUtils(); Token mockToken = mock(Token.class); given(mockToken.getBlob()).willReturn("badger".getBytes(TokenBlobUtils.ENCODING)); utils.getBlobAsString(mockToken); verify(mockToken).getBlob(); }
public String getBlobAsString(Token token) { try { return new String(token.getBlob(), ENCODING); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to decode blob to " + ENCODING, e); } }
TokenBlobUtils { public String getBlobAsString(Token token) { try { return new String(token.getBlob(), ENCODING); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to decode blob to " + ENCODING, e); } } }
TokenBlobUtils { public String getBlobAsString(Token token) { try { return new String(token.getBlob(), ENCODING); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to decode blob to " + ENCODING, e); } }  }
TokenBlobUtils { public String getBlobAsString(Token token) { try { return new String(token.getBlob(), ENCODING); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to decode blob to " + ENCODING, e); } }  String getBlobAsString(Token token); void setBlobFromString(Token token, String blob); }
TokenBlobUtils { public String getBlobAsString(Token token) { try { return new String(token.getBlob(), ENCODING); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to decode blob to " + ENCODING, e); } }  String getBlobAsString(Token token); void setBlobFromString(Token token, String blob); static final String ENCODING; }