@Test(expected = Exception.class) public void testWithOtherStream() { sut1.buildForStream(EntityType.RESOURCE, 8L); }
public String buildForStream(final EntityType streamEntityType, final long streamEntityId) { String metaKey; switch (streamEntityType) { case PERSON: metaKey = META_KEY_PERSON_STREAM; break; case GROUP: metaKey = META_KEY_GROUP_STREAM; break; default: throw new IllegalArgumentException("Only person and group streams are allowed."); } return metaKey + streamEntityId; }
TokenContentFormatter { public String buildForStream(final EntityType streamEntityType, final long streamEntityId) { String metaKey; switch (streamEntityType) { case PERSON: metaKey = META_KEY_PERSON_STREAM; break; case GROUP: metaKey = META_KEY_GROUP_STREAM; break; default: throw new IllegalArgumentException("Only person and group streams are allowed."); } return metaKey + streamEntityId; } }
TokenContentFormatter { public String buildForStream(final EntityType streamEntityType, final long streamEntityId) { String metaKey; switch (streamEntityType) { case PERSON: metaKey = META_KEY_PERSON_STREAM; break; case GROUP: metaKey = META_KEY_GROUP_STREAM; break; default: throw new IllegalArgumentException("Only person and group streams are allowed."); } return metaKey + streamEntityId; }  }
TokenContentFormatter { public String buildForStream(final EntityType streamEntityType, final long streamEntityId) { String metaKey; switch (streamEntityType) { case PERSON: metaKey = META_KEY_PERSON_STREAM; break; case GROUP: metaKey = META_KEY_GROUP_STREAM; break; default: throw new IllegalArgumentException("Only person and group streams are allowed."); } return metaKey + streamEntityId; }  String buildForStream(final EntityType streamEntityType, final long streamEntityId); String buildForActivity(final long activityId); String build(final Map<String, Long> data); Map<String, Long> parse(final String tokenContent); }
TokenContentFormatter { public String buildForStream(final EntityType streamEntityType, final long streamEntityId) { String metaKey; switch (streamEntityType) { case PERSON: metaKey = META_KEY_PERSON_STREAM; break; case GROUP: metaKey = META_KEY_GROUP_STREAM; break; default: throw new IllegalArgumentException("Only person and group streams are allowed."); } return metaKey + streamEntityId; }  String buildForStream(final EntityType streamEntityType, final long streamEntityId); String buildForActivity(final long activityId); String build(final Map<String, Long> data); Map<String, Long> parse(final String tokenContent); static final String META_KEY_ACTOR; static final String META_KEY_PERSON_STREAM; static final String META_KEY_GROUP_STREAM; static final String META_KEY_ACTIVITY; }