
entry-point.rest-webflux.api.unit.test.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.api;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.web.reactive.server.WebTestClient;
@ContextConfiguration(classes = {ApiRest.class})
@WebFluxTest
class ApiRestTest {
@Autowired
private WebTestClient webTestClient;
@Test
void testCommandName() {
webTestClient.get()
.uri("/api/path")
.accept(MediaType.APPLICATION_JSON)
.exchange()
.expectStatus().isOk()
.expectBody(String.class)
.value(userResponse -> {
Assertions.assertThat(userResponse).isEmpty();
}
);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy