aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-12-07 18:32:27 +0300
committerGravatar Vitaly Takmazov2020-12-07 18:33:10 +0300
commit8e9b670b272b8f030a1035cb7918e9fc0fea89a5 (patch)
tree79326bdfb119728a3dea37316c555ea2ca638a73 /src/test/java/com/juick
parent75b985391dc47d11edc87fee099a85dc30edd386 (diff)
springfox -> springdoc
Diffstat (limited to 'src/test/java/com/juick')
-rw-r--r--src/test/java/com/juick/config/SwaggerConfiguration.java31
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java2
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();