Skip to content
Snippets Groups Projects
Commit c751b6dd authored by Karsch Lukas's avatar Karsch Lukas
Browse files

#59 Finished integration tests - now contains garden, wishlist and plants

parent 760e8bb2
No related branches found
No related tags found
1 merge request!50Resolve "Integration tests"
Pipeline #58474 failed
......@@ -3,13 +3,13 @@ cache:
- .m2/
stages:
- build
- compile
- test
- package
maven-build:
maven-compile:
image: maven:3.8.5-openjdk-17
stage: build
stage: compile
script:
- "echo 'Starting Build Process'"
- "mvn compile"
......@@ -43,5 +43,3 @@ maven-package:
paths:
- target/*.jar
expire_in: 2 days
......@@ -104,4 +104,20 @@ class PlantsIntegrationTest extends BaseIntegrationTest {
.andExpect(status().isOk())
.andExpect(jsonPath("$.plant.name").value(pflanzeNumeroUno.getName()));
}
@Test
void admin_shouldUpdatePlant_code200() throws Exception {
PlantUpdateRequest updateRequest = PlantUpdateRequest.builder().name("new name!").build();
mvc.perform(patch(plantsUrl + "/1")
.headers(adminAuthHeader)
.content(jsonMapper.convertObjectToJson(updateRequest))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$.name").value(updateRequest.getName()));
mvc.perform(get(plantsUrl + "/1").headers(authHeader))
.andExpect(status().isOk())
.andExpect(jsonPath("$.name").value(updateRequest.getName()));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment