Merge "Doc VID version 3.2.3"
authorWojciech Sliwka <wojciech.sliwka@nokia.com>
Wed, 10 Apr 2019 10:44:04 +0000 (10:44 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 10 Apr 2019 10:44:04 +0000 (10:44 +0000)
vid-app-common/pom.xml
vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
vid-app-common/src/main/java/org/onap/vid/controller/open/HealthCheckController.java [moved from vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java with 98% similarity]
vid-app-common/src/main/java/org/onap/vid/controller/open/MaintenanceController.java [moved from vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java with 99% similarity]
vid-app-common/src/main/java/org/onap/vid/controller/open/RoleGeneratorController.java [moved from vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java with 98% similarity]
vid-app-common/src/main/java/org/onap/vid/controller/open/VersionController.java [moved from vid-app-common/src/main/java/org/onap/vid/controller/VersionController.java with 98% similarity]
vid-app-common/src/test/java/org/onap/vid/controller/open/HealthCheckControllerTest.java [moved from vid-app-common/src/test/java/org/onap/vid/controller/HealthCheckControllerTest.java with 98% similarity]
vid-app-common/src/test/java/org/onap/vid/controller/open/MaintenanceControllerTest.java [moved from vid-app-common/src/test/java/org/onap/vid/controller/MaintenanceControllerTest.java with 99% similarity]
vid-app-common/src/test/java/org/onap/vid/controller/open/RoleGeneratorControllerTest.java [moved from vid-app-common/src/test/java/org/onap/vid/controller/RoleGeneratorControllerTest.java with 96% similarity]
vid-app-common/src/test/java/org/onap/vid/controller/open/VersionControllerTest.java [moved from vid-app-common/src/test/java/org/onap/vid/controller/VersionControllerTest.java with 95% similarity]

index 205d642..0cc2195 100755 (executable)
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.9.2</version>
+        </dependency>
     </dependencies>
 </project>
index 543aa94..e00c2d7 100644 (file)
@@ -42,11 +42,18 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.togglz.core.manager.FeatureManager;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
 
 import javax.servlet.ServletContext;
 import java.io.File;
 import java.io.IOException;
 
+@EnableSwagger2
 @Configuration
 public class WebConfig {
 
@@ -193,4 +200,12 @@ public class WebConfig {
 
     }
 
+    @Bean
+    public Docket api(){
+        return new Docket(DocumentationType.SWAGGER_2)
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("org.onap.vid.controller.open"))
+                .paths(PathSelectors.any())
+                .build();
+    }
 }
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 import org.onap.portalsdk.core.controller.UnRestrictedBaseController;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.vid.controller.HealthStatus;
 import org.onap.vid.dao.FnAppDoaImpl;
 import org.onap.vid.model.GitRepositoryState;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 
 import com.fasterxml.jackson.core.type.TypeReference;
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 import org.apache.log4j.BasicConfigurator;
 import org.junit.Before;
@@ -26,6 +26,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.vid.controller.open.HealthCheckController;
 import org.onap.vid.dao.FnAppDoaImpl;
 import org.springframework.http.MediaType;
 import org.springframework.test.web.servlet.MockMvc;
@@ -1,4 +1,4 @@
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 /*-
  * ============LICENSE_START=======================================================
@@ -35,6 +35,7 @@ import org.onap.vid.category.AddCategoryOptionResponse;
 import org.onap.vid.category.AddCategoryOptionsRequest;
 import org.onap.vid.category.CategoryParameterOptionRep;
 import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.controller.open.MaintenanceController;
 import org.onap.vid.model.CategoryParameter;
 import org.onap.vid.model.CategoryParameterOption;
 import org.onap.vid.services.CategoryParameterService;
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 import static org.mockito.BDDMockito.given;
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
@@ -32,6 +32,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.vid.controller.open.RoleGeneratorController;
 import org.onap.vid.services.RoleGeneratorService;
 import org.springframework.http.MediaType;
 import org.springframework.test.web.servlet.MockMvc;
@@ -18,8 +18,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
+import org.onap.vid.controller.open.VersionController;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;