PMT-37: Alle informationen eines bestimmten Projektes abrufen #19
1 changed files with 37 additions and 0 deletions
37
src/test/java/de/hmmh/pmt/project/GetProjectInfoTest.java
Normal file
37
src/test/java/de/hmmh/pmt/project/GetProjectInfoTest.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
package de.hmmh.pmt.project;
|
||||
|
||||
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 java.util.Map;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import de.hmmh.pmt.IntegrationTest;
|
||||
import de.hmmh.pmt.db.Project;
|
||||
|
||||
public class GetProjectInfoTest extends IntegrationTest {
|
||||
|
||||
@Test
|
||||
void noProject() throws Exception {
|
||||
mvc
|
||||
.perform(get(baseUri + "/project/1"))
|
||||
.andExpect(status().isNotFound());
|
||||
}
|
||||
|
||||
@Test
|
||||
void getProjectInfo() throws Exception {
|
||||
Map<String, Project> allProjects = createTestProjectData();
|
||||
Project spaceStation = allProjects.get("space-station");
|
||||
mvc
|
||||
.perform(get(baseUri + "/project/" +spaceStation.getId()))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.id").value(spaceStation.getId()))
|
||||
.andExpect(jsonPath("$.name").value(spaceStation.getName()))
|
||||
.andExpect(jsonPath("$.goal").value(spaceStation.getGoal()))
|
||||
.andExpect(jsonPath("$.customerId").value(spaceStation.getCustomerId()))
|
||||
.andExpect(jsonPath("$.administratorId").value(spaceStation.getAdministratorId()))
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue