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