diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/juick/config/SwaggerConfiguration.java | 31 | ||||
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 2 |
2 files changed, 14 insertions, 19 deletions
diff --git a/src/test/java/com/juick/config/SwaggerConfiguration.java b/src/test/java/com/juick/config/SwaggerConfiguration.java index f92ef6c0..d3eb7185 100644 --- a/src/test/java/com/juick/config/SwaggerConfiguration.java +++ b/src/test/java/com/juick/config/SwaggerConfiguration.java @@ -17,29 +17,24 @@ package com.juick.config; -import com.google.common.base.Predicates; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import java.util.Collections; @Configuration -@EnableSwagger2 public class SwaggerConfiguration { @Bean - public Docket api() { - return new Docket(DocumentationType.SWAGGER_2) - .host("api.juick.com") - .select() - .apis(Predicates.not(Predicates.or(RequestHandlerSelectors.basePackage("org.springframework.boot"), RequestHandlerSelectors.basePackage("com.juick.server.www")))) - .paths(PathSelectors.any()).build().apiInfo(new ApiInfo("Juick API", "Juick REST API Documentation", - "2.0", "https://juick.com/help/tos", null, - "AGPLv3", "https://www.gnu.org/licenses/agpl-3.0.html", Collections.emptyList())); + public OpenAPI api() { + return new OpenAPI() + .info(new Info() + .title("Juick API") + .version("2.0") + .description("Juick Rest API Documentation") + .termsOfService("https://juick.com/help/tos") + .license(new License() + .name("AGPLv3") + .url("https://www.gnu.org/licenses/agpl-3.0.html"))); } } diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index f8d3bfdc..33b0f0da 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1801,7 +1801,7 @@ public class ServerTests { @Test public void swaggerOutput() throws Exception { - MvcResult result = mockMvc.perform(get("/v2/api-docs") + MvcResult result = mockMvc.perform(get("/v3/api-docs") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andReturn(); |