Falsch platzierte Methode aus RecordHandler entfernt
[demos/kafka/training] / src / test / java / de / juplo / kafka / ApplicationTests.java
index 740c09c..6a037eb 100644 (file)
@@ -124,15 +124,29 @@ public class ApplicationTests extends GenericApplicationTests<String, String>
             tests.stateRepository.findById(Integer.toString(i)).get();
 
         stateDocument
-            .results.entrySet().stream()
+            .results
+            .entrySet()
+            .stream()
             .forEach(entry ->
             {
               String user = entry.getKey();
               List<AdderResult> resultsForUser = entry.getValue();
 
+              for (int j=0; j < resultsForUser.size(); j++)
+              {
+                if (!(j < state.get(user).size()))
+                {
+                  break;
+                }
+
+                assertThat(resultsForUser.get(j))
+                    .as("Unexpected results calculation %d of user %s", j, user)
+                    .isEqualTo(state.get(user).get(j));
+              }
+
               assertThat(state.get(user))
-                  .as("Unexpected results for user %s", user)
-                  .containsExactlyElementsOf(resultsForUser);
+                  .as("More results calculated for user %s as expected", user)
+                  .containsAll(resultsForUser);
             });
       }
     }