</parent>
<groupId>de.juplo.kafka.wordcount</groupId>
<artifactId>query</artifactId>
- <version>2.0.0</version>
+ <version>2.0.1</version>
<name>Wordcount-Query</name>
<description>Query stream-processor of the multi-user wordcount-example</description>
<properties>
static void assertExpectedState(Function<String, UserRanking> function)
{
- assertRankingEqualsRankingFromLastMessage(PETER.getUsername(), function.apply(PETER.getUsername()));
- assertRankingEqualsRankingFromLastMessage(KLAUS.getUsername(), function.apply(KLAUS.getUsername()));
+ assertRankingEqualsRankingFromLastMessage(PETER.getUser(), function.apply(PETER.getUser()));
+ assertRankingEqualsRankingFromLastMessage(KLAUS.getUser(), function.apply(KLAUS.getUser()));
}
private static void assertRankingEqualsRankingFromLastMessage(String user, UserRanking rankingJson)
private static UserRanking getLastMessageFor(String user)
{
return getTop10Messages()
- .filter(kv -> kv.key.getUsername().equals(user))
+ .filter(kv -> kv.key.getUser().equals(user))
.map(kv -> kv.value)
.map(testRanking -> userRankingFor(user, testRanking))
.reduce(null, (left, right) -> right);
{
Entry entry = new Entry();
entry.setWord(testEntry.getWord());
- entry.setCount(testEntry.getCount());
+ entry.setCount(testEntry.getCounter());
return entry;
}
private static KeyValue<TestUser, TestRanking>[] TOP10_MESSAGES = new KeyValue[]
private static KeyValue<String, TestUserData>[] USERS_MESSAGES = new KeyValue[]
{
KeyValue.pair(
- PETER.getUsername(),
- TestUserData.of(PETER.getUsername(), "Peter", "Pan", TestUserData.Sex.MALE)),
+ PETER.getUser(),
+ TestUserData.of(PETER.getUser(), "Peter", "Pan", TestUserData.Sex.MALE)),
KeyValue.pair(
- KLAUS.getUsername(),
- TestUserData.of(KLAUS.getUsername(), "Klaus", "Klüse", TestUserData.Sex.OTHER)),
+ KLAUS.getUser(),
+ TestUserData.of(KLAUS.getUser(), "Klaus", "Klüse", TestUserData.Sex.OTHER)),
};
}