@Test public void shouldIndicateNoValidFieldsInJSON() { assertEquals(-1, adapter.findIndexOfValidField("")); }
public int findIndexOfValidField(String blob) { for (Field field : AttributeCompressionStrategy.getAllValidFields(InternalSession.class)) { String search = JSONSerialisation.jsonAttributeName(field.getName()); int index = blob.indexOf(search); if (index != -1) { return index; } } return -1; }
SessionAdapter implements TokenAdapter<InternalSession> { public int findIndexOfValidField(String blob) { for (Field field : AttributeCompressionStrategy.getAllValidFields(InternalSession.class)) { String search = JSONSerialisation.jsonAttributeName(field.getName()); int index = blob.indexOf(search); if (index != -1) { return index; } } return -1; } }
SessionAdapter implements TokenAdapter<InternalSession> { public int findIndexOfValidField(String blob) { for (Field field : AttributeCompressionStrategy.getAllValidFields(InternalSession.class)) { String search = JSONSerialisation.jsonAttributeName(field.getName()); int index = blob.indexOf(search); if (index != -1) { return index; } } return -1; } @Inject  SessionAdapter(TokenIdFactory tokenIdFactory, CoreTokenConfig config,
                          JSONSerialisation serialisation, LDAPDataConversion dataConversion,
                          TokenBlobUtils blobUtils); }
SessionAdapter implements TokenAdapter<InternalSession> { public int findIndexOfValidField(String blob) { for (Field field : AttributeCompressionStrategy.getAllValidFields(InternalSession.class)) { String search = JSONSerialisation.jsonAttributeName(field.getName()); int index = blob.indexOf(search); if (index != -1) { return index; } } return -1; } @Inject  SessionAdapter(TokenIdFactory tokenIdFactory, CoreTokenConfig config,
                          JSONSerialisation serialisation, LDAPDataConversion dataConversion,
                          TokenBlobUtils blobUtils); Token toToken(InternalSession session); InternalSession fromToken(Token token); int findIndexOfValidField(String blob); String filterLatestAccessTime(Token token); }
SessionAdapter implements TokenAdapter<InternalSession> { public int findIndexOfValidField(String blob) { for (Field field : AttributeCompressionStrategy.getAllValidFields(InternalSession.class)) { String search = JSONSerialisation.jsonAttributeName(field.getName()); int index = blob.indexOf(search); if (index != -1) { return index; } } return -1; } @Inject  SessionAdapter(TokenIdFactory tokenIdFactory, CoreTokenConfig config,
                          JSONSerialisation serialisation, LDAPDataConversion dataConversion,
                          TokenBlobUtils blobUtils); Token toToken(InternalSession session); InternalSession fromToken(Token token); int findIndexOfValidField(String blob); String filterLatestAccessTime(Token token);  }