added svcapi ui and camunda code
[it/otf.git] / otf-service-api / src / main / java / org / oran / otf / api / Application.java
diff --git a/otf-service-api/src/main/java/org/oran/otf/api/Application.java b/otf-service-api/src/main/java/org/oran/otf/api/Application.java
new file mode 100644 (file)
index 0000000..8836555
--- /dev/null
@@ -0,0 +1,74 @@
+/*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
+#                                                                              #\r
+#   Licensed under the Apache License, Version 2.0 (the "License");            #\r
+#   you may not use this file except in compliance with the License.           #\r
+#   You may obtain a copy of the License at                                    #\r
+#                                                                              #\r
+#       http://www.apache.org/licenses/LICENSE-2.0                             #\r
+#                                                                              #\r
+#   Unless required by applicable law or agreed to in writing, software        #\r
+#   distributed under the License is distributed on an "AS IS" BASIS,          #\r
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
+#   See the License for the specific language governing permissions and        #\r
+#   limitations under the License.                                             #\r
+##############################################################################*/\r
+\r
+\r
+package org.oran.otf.api;\r
+\r
+import static com.google.common.collect.Sets.newHashSet;\r
+\r
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;\r
+import io.swagger.v3.oas.annotations.info.Contact;\r
+import io.swagger.v3.oas.annotations.info.Info;\r
+import org.apache.commons.logging.Log;\r
+import org.apache.commons.logging.LogFactory;\r
+import org.springframework.boot.SpringApplication;\r
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;\r
+import org.springframework.boot.autoconfigure.SpringBootApplication;\r
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;\r
+import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;\r
+import org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration;\r
+import org.springframework.context.ApplicationContext;\r
+import org.springframework.context.annotation.Bean;\r
+import org.springframework.context.annotation.ComponentScan;\r
+import org.springframework.context.annotation.Configuration;\r
+import springfox.documentation.builders.PathSelectors;\r
+import springfox.documentation.spi.DocumentationType;\r
+import springfox.documentation.spring.web.plugins.Docket;\r
+import springfox.documentation.swagger2.annotations.EnableSwagger2;\r
+\r
+@SpringBootApplication\r
+@Configuration\r
+@EnableAutoConfiguration(\r
+    exclude = {\r
+      ErrorMvcAutoConfiguration.class,\r
+      DataSourceAutoConfiguration.class,\r
+      HibernateJpaAutoConfiguration.class,\r
+    })\r
+@ComponentScan(basePackages = "org.oran.otf")\r
+@EnableSwagger2\r
+@OpenAPIDefinition(\r
+    info =\r
+        @Info(\r
+            title = "Open Test Framework API",\r
+            version = "1.0",\r
+            description = "A RESTful API used to communicate with the OTF test control unit.",\r
+            contact = @Contact(url = "https://localhost:32524", name = "OTF")))\r
+public class Application {\r
+  private static final Log log = LogFactory.getLog(Application.class);\r
+\r
+  public static void main(String[] args) {\r
+    ApplicationContext ctx = SpringApplication.run(Application.class, args);\r
+  }\r
+\r
+  @Bean\r
+  public Docket testInstanceApi() {\r
+    return new Docket(DocumentationType.SWAGGER_2)\r
+        .select()\r
+        // .apis(testInstancePath())\r
+        .paths(PathSelectors.any())\r
+        .build()\r
+        .protocols(newHashSet("https"));\r
+  }\r
+}\r