Skip to content
Snippets Groups Projects
Commit 1b09d06d authored by Krzysztof Witukiewicz's avatar Krzysztof Witukiewicz
Browse files

OZG-7773 OZG-8001 Fix test

parent 0a291f21
No related branches found
No related tags found
1 merge request!27Ozg 7773 nachrichten auf ungelesen setzen
......@@ -39,6 +39,8 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
......@@ -281,24 +283,16 @@ class VorgangControllerITCase {
@Nested
class TestClientAttribute {
@Test
void shouldReturnNoContent() throws Exception {
var content = VorgangHeaderTestFactory.createHasNewPostfachNachrichtContent(false);
@ParameterizedTest
@ValueSource(booleans = {true, false})
void shouldReturnNoContent(boolean hasNewPostfachNachricht) throws Exception {
var content = VorgangHeaderTestFactory.createHasNewPostfachNachrichtContent(hasNewPostfachNachricht);
var response = doRequest(content);
response.andExpect(status().isNoContent());
}
@Test
void shouldReturnUnprocessableEntity() throws Exception {
var content = VorgangHeaderTestFactory.createHasNewPostfachNachrichtContent(true);
var response = doRequest(content);
response.andExpect(status().isUnprocessableEntity());
}
private ResultActions doRequest(String content) throws Exception {
return mockMvc.perform(put("/api/vorgangs/{0}/hasNewPostfachNachricht", VorgangHeaderTestFactory.ID).with(csrf())
.contentType(MediaType.APPLICATION_JSON)
......
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