From cda04fa8a23087b919c02d2f4acc700b5b457720 Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 23 Oct 2024 10:34:24 +0200
Subject: [PATCH] Remove var
---
.../project/AddEmployeeToProjectTest.java | 11 +++-----
.../project/CreateProjectActionTest.java | 28 +++++++++----------
.../project/GetProjectActionTest.java | 2 +-
.../project/ProjectFindAllSuccessTest.java | 4 +--
.../project/RemoveProjectActionTest.java | 2 +-
.../project/UpdateProjectActionTest.java | 15 +++++-----
6 files changed, 30 insertions(+), 32 deletions(-)
diff --git a/src/test/java/de/szut/lf8_starter/integration/project/AddEmployeeToProjectTest.java b/src/test/java/de/szut/lf8_starter/integration/project/AddEmployeeToProjectTest.java
index 570687a..4193e77 100644
--- a/src/test/java/de/szut/lf8_starter/integration/project/AddEmployeeToProjectTest.java
+++ b/src/test/java/de/szut/lf8_starter/integration/project/AddEmployeeToProjectTest.java
@@ -6,10 +6,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.MediaType;
+import org.springframework.http.*;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@@ -37,7 +34,7 @@ class AddEmployeeToProjectActionIntegrationTest {
@Test
void addEmployeeToProjectTest() throws Exception {
- var project = new ProjectEntity();
+ ProjectEntity project = new ProjectEntity();
project.setComment("comment");
project.setContractor(1);
project.setContractorName("contractorName");
@@ -54,7 +51,7 @@ class AddEmployeeToProjectActionIntegrationTest {
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isNoContent());
- var updatedProject = projectRepository.findById(1L).get();
+ ProjectEntity updatedProject = projectRepository.findById(1L).get();
assert updatedProject.getEmployees().contains(312L);
}
@@ -73,7 +70,7 @@ class AddEmployeeToProjectActionIntegrationTest {
HttpEntity> request = new HttpEntity<>(map, headers);
- var response = this.restTemplate.exchange(url, HttpMethod.POST, request, Map.class);
+ ResponseEntity