|
|
@ -21,10 +21,9 @@ import java.util.Arrays;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Before;
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
import org.junit.Rule;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.actuate.web.mappings.MappingDescriptionProvider;
|
|
|
|
import org.springframework.boot.actuate.web.mappings.MappingDescriptionProvider;
|
|
|
|
import org.springframework.boot.actuate.web.mappings.MappingsEndpoint;
|
|
|
|
import org.springframework.boot.actuate.web.mappings.MappingsEndpoint;
|
|
|
@ -38,10 +37,10 @@ import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.restdocs.JUnitRestDocumentation;
|
|
|
|
import org.springframework.restdocs.RestDocumentationContextProvider;
|
|
|
|
|
|
|
|
import org.springframework.restdocs.RestDocumentationExtension;
|
|
|
|
import org.springframework.restdocs.payload.FieldDescriptor;
|
|
|
|
import org.springframework.restdocs.payload.FieldDescriptor;
|
|
|
|
import org.springframework.restdocs.payload.JsonFieldType;
|
|
|
|
import org.springframework.restdocs.payload.JsonFieldType;
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
|
|
import org.springframework.test.web.reactive.server.WebTestClient;
|
|
|
|
import org.springframework.test.web.reactive.server.WebTestClient;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@ -61,23 +60,20 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
|
@ExtendWith(RestDocumentationExtension.class)
|
|
|
|
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "spring.main.web-application-type=reactive")
|
|
|
|
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "spring.main.web-application-type=reactive")
|
|
|
|
public class MappingsEndpointReactiveDocumentationTests
|
|
|
|
public class MappingsEndpointReactiveDocumentationTests
|
|
|
|
extends AbstractEndpointDocumentationTests {
|
|
|
|
extends AbstractEndpointDocumentationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Rule
|
|
|
|
|
|
|
|
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@LocalServerPort
|
|
|
|
@LocalServerPort
|
|
|
|
private int port;
|
|
|
|
private int port;
|
|
|
|
|
|
|
|
|
|
|
|
private WebTestClient client;
|
|
|
|
private WebTestClient client;
|
|
|
|
|
|
|
|
|
|
|
|
@Before
|
|
|
|
@BeforeEach
|
|
|
|
public void webTestClient() {
|
|
|
|
public void webTestClient(RestDocumentationContextProvider restDocumentation) {
|
|
|
|
this.client = WebTestClient
|
|
|
|
this.client = WebTestClient
|
|
|
|
.bindToServer().filter(documentationConfiguration(this.restDocumentation)
|
|
|
|
.bindToServer().filter(documentationConfiguration(restDocumentation)
|
|
|
|
.snippets().withDefaults())
|
|
|
|
.snippets().withDefaults())
|
|
|
|
.baseUrl("http://localhost:" + this.port).build();
|
|
|
|
.baseUrl("http://localhost:" + this.port).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|