data buffer limit exception (#12862)

* data buffer limit exception

* removed mvn scripts

* test cases

* updated integration test name

Co-authored-by: s9m33r <no-reply>
This commit is contained in:
Sameer
2022-10-16 09:07:24 +05:30
committed by GitHub
parent 33cb4f90e0
commit 12bb231be4
17 changed files with 26288 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
package com.baeldung.spring.reactive.springreactiveexceptions;
import com.baeldung.spring.reactive.springreactiveexceptions.model.Users;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpStatus;
import org.springframework.test.web.reactive.server.WebTestClient;
import org.springframework.web.reactive.function.BodyInserters;
import java.io.IOException;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class SpringReactiveExceptionsApplicationIntegrationTest {
@Autowired
private WebTestClient webTestClient;
@Autowired
private ObjectMapper objectMapper;
@Test
void givenARequestBody_whenProcessIsCalled_thenReturnTheBodyAsIs() throws IOException {
Users users = objectMapper.readValue(new ClassPathResource("390KB.json")
.getURL(), Users.class);
webTestClient
.post()
.uri("1.0/process")
.body(BodyInserters.fromValue(users))
.exchange()
.expectStatus()
.isEqualTo(HttpStatus.OK)
.expectBody(Users.class)
.isEqualTo(users);
}
@Test
void whenTriggerIsCalled_thenReturnTheExpectedJSONResponse() throws IOException {
Users users = objectMapper.readValue(new ClassPathResource("390KB.json")
.getURL(), Users.class);
webTestClient
.post()
.uri("1.0/trigger")
.exchange()
.expectStatus()
.isEqualTo(HttpStatus.OK)
.expectBody(Users.class)
.isEqualTo(users);
}
}

File diff suppressed because it is too large Load Diff