From fa607435cf430c6946e618489d79a7792d07e459 Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 23 Oct 2024 10:37:01 +0200
Subject: [PATCH] Fix
---
.../integration/project/CreateProjectActionTest.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/test/java/de/szut/lf8_starter/integration/project/CreateProjectActionTest.java b/src/test/java/de/szut/lf8_starter/integration/project/CreateProjectActionTest.java
index 6a340ca..27fe186 100644
--- a/src/test/java/de/szut/lf8_starter/integration/project/CreateProjectActionTest.java
+++ b/src/test/java/de/szut/lf8_starter/integration/project/CreateProjectActionTest.java
@@ -12,7 +12,9 @@ import org.springframework.test.web.servlet.MockMvc;
import java.time.LocalDate;
import java.util.Arrays;
+import java.util.Optional;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
@@ -59,7 +61,7 @@ class CreateProjectActionTest {
final long id = Long.parseLong(new JSONObject(contentAsString).get("id").toString());
- final ProjectEntity project = this.projectRepository.findById(id);
+ final Optional project = this.projectRepository.findById(id);
assertThat(project.get().getName()).isEqualTo("name");
assertThat(project.get().getLeadingEmployee()).isEqualTo(1);
assertThat(project.get().getContractor()).isEqualTo(4);