From 11a92a6cdba38a3b4c8e11a4f520d9b819e525cd Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sat, 23 Sep 2023 22:42:19 +0200 Subject: [PATCH] fix flaky test --- .../java/de/tum/in/www1/artemis/course/CourseTestService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java index 77151499fcde..17598432a202 100644 --- a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java +++ b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java @@ -3087,10 +3087,10 @@ public void testEditCourseRemoveExistingIcon() throws Exception { savedCourseWithFile.setCourseIcon(null); request.putWithMultipartFile("/api/courses/" + savedCourseWithFile.getId(), savedCourseWithFile, "course", null, Course.class, HttpStatus.OK, null); - + await().until(() -> !Files.exists(path)); course = courseRepo.findByIdElseThrow(course.getId()); assertThat(course.getCourseIcon()).as("course icon was deleted correctly").isNull(); - assertThat(path.toFile()).as("course icon file was deleted correctly").doesNotExist(); + assertThat(path).as("course icon file was deleted correctly").doesNotExist(); } private String getUpdateOnlineCourseConfigurationPath(String courseId) {