This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects

fixed e2e tests

Merged Eduard Frankford requested to merge fix_e2e_tests into development
@@ -348,10 +348,15 @@ public class StatisticsResourceIT {
//After the following call a new statistics entity for the exerciseID 143 should have been created because there exists a resource with this id in elastic search from stefan podlipnig
restStatisticsMockMvc.perform(get("/api/statistics/exercise/{id}", "143").with(csrf().asHeader())).andExpect(status().isOk());
//wait for the statistics to be created
Thread.sleep(1000);
assertEquals(statisticsService.findOneByExerciseID("143").get().getExerciseID(), "143");
//Do the same call again to see if the statisticsService understood that the entity already exists and it only needs to increase the views
restStatisticsMockMvc.perform(get("/api/statistics/exercise/{id}", "143").with(csrf().asHeader())).andExpect(status().isOk());
//wait for the statistics to be created
Thread.sleep(1000);
assertEquals(statisticsService.findOneByExerciseID("143").get().getViews(), 2);
//Test the search for an id which does not exist