From 089b777ea8bc46e9d67dc9a9dfba50da23182c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20K=C3=BCck?= Date: Wed, 23 Oct 2024 15:31:47 +0200 Subject: [PATCH] PMT-37-added uncompleted Test cases --- .../hmmh/pmt/project/GetProjectInfoTest.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/java/de/hmmh/pmt/project/GetProjectInfoTest.java diff --git a/src/test/java/de/hmmh/pmt/project/GetProjectInfoTest.java b/src/test/java/de/hmmh/pmt/project/GetProjectInfoTest.java new file mode 100644 index 0000000..e77b2f1 --- /dev/null +++ b/src/test/java/de/hmmh/pmt/project/GetProjectInfoTest.java @@ -0,0 +1,31 @@ +package de.hmmh.pmt.project; + +import static org.hamcrest.Matchers.empty; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.jupiter.api.Test; +import org.springframework.http.MediaType; +import org.springframework.test.web.servlet.RequestBuilder; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; + +import de.hmmh.pmt.IntegrationTest; + +public class GetProjectInfoTest extends IntegrationTest { + + @Test + void noProject() throws Exception { + mvc + .perform(get(baseUri + "/project/1")) + .andExpect(status().isNotFound()); + } + + @Test + public RequestBuilder getProjectInfo(Long projectId) throws Exception { + return MockMvcRequestBuilders + .get("/project/" + projectId) + .contentType(MediaType.APPLICATION_JSON); + } + +}