update sliapi-springboot 14/102914/2
authorSmokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Tue, 3 Mar 2020 21:53:18 +0000 (21:53 +0000)
committerSmokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Wed, 4 Mar 2020 14:22:28 +0000 (14:22 +0000)
organize sli api spring boot project

Issue-ID: CCSDK-2154
Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Change-Id: Ic1690b8addf0134220b49a01d04e41eaeabf7bb6

sliapi/springboot/pom.xml
sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/App.java [new file with mode: 0644]
sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/controllers/ExecuteGraphController.java [moved from sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/ExecuteGraphController.java with 80% similarity]
sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/controllers/swagger/RestconfApiController.java [moved from sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/RestconfApiController.java with 79% similarity]
sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java [new file with mode: 0644]
sliapi/springboot/src/main/resources/application.properties
sliapi/springboot/src/test/java/org/onap/ccsdk/sli/core/sliapi/springboot/RestconfApiControllerTest.java

index 6b182db..e3cca4b 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+       <modelVersion>4.0.0</modelVersion>
 
-    <parent>
-        <groupId>org.onap.ccsdk.parent</groupId>
-        <artifactId>spring-boot-starter-parent</artifactId>
-        <version>1.5.2-SNAPSHOT</version>
+       <parent>
+               <groupId>org.onap.ccsdk.parent</groupId>
+               <artifactId>spring-boot-starter-parent</artifactId>
+               <version>1.5.2-SNAPSHOT</version>
         <relativePath/>
-    </parent>
+       </parent>
 
-    <groupId>org.onap.ccsdk.sli.core</groupId>
-    <artifactId>sliapi-springboot</artifactId>
-    <version>0.7.1-SNAPSHOT</version>
-    <packaging>jar</packaging>
+       <groupId>org.onap.ccsdk.sli.core</groupId>
+       <artifactId>sliapi-springboot</artifactId>
+       <version>0.7.1-SNAPSHOT</version>
+       <packaging>jar</packaging>
 
     <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
 
-    <dependencies>
-        <dependency>
-            <groupId>io.swagger</groupId>
-            <artifactId>swagger-annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
+    <properties>
+          <start-class>org.onap.ccsdk.sli.core.sliapi.springboot.App</start-class>
+    </properties>
+
+       <dependencies>
+               <dependency>
+                       <groupId>io.swagger</groupId>
+                       <artifactId>swagger-annotations</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework.boot</groupId>
+                       <artifactId>spring-boot-starter-web</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-jpa</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger2</artifactId>
-            <version>2.9.2</version>
-        </dependency>
-
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger-ui</artifactId>
-            <version>2.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>sli-provider-base</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derby</artifactId>
-            <scope>runtime</scope>
-        </dependency>
+                       <artifactId>spring-boot-starter-data-jpa</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>io.springfox</groupId>
+                       <artifactId>springfox-swagger2</artifactId>
+                       <version>2.9.2</version>
+               </dependency>
+               <dependency>
+                       <groupId>io.springfox</groupId>
+                       <artifactId>springfox-swagger-ui</artifactId>
+                       <version>2.9.2</version>
+               </dependency>
+               <dependency>
+                       <groupId>${project.groupId}</groupId>
+                       <artifactId>sli-provider-base</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.google.code.gson</groupId>
+                       <artifactId>gson</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.derby</groupId>
+                       <artifactId>derby</artifactId>
+                       <scope>runtime</scope>
+               </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>io.swagger</groupId>
-                <artifactId>swagger-codegen-maven-plugin</artifactId>
-                <version>2.3.1</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>generate</goal>
-                        </goals>
-                        <configuration>
-                            <output>target/generated-sources</output>
-                            <inputSpec>${project.basedir}/../model/src/main/resources/sli-api.20161110.yaml</inputSpec>
-                            <language>spring</language>
-                            <apiPackage>org.onap.ccsdk.sli.core.sliapi.springboot</apiPackage>
-                            <modelPackage>org.onap.ccsdk.sli.core.sliapi.model</modelPackage>
-                            <invokerPackage>org.onap.ccsdk.sli.core.sliapi.springboot</invokerPackage>
-                            <generateApis>true</generateApis>
-                            <generateApiTests>true</generateApiTests>
-                            <ignoreFileOverride>${project.basedir}/.swagger-codegen-ignore</ignoreFileOverride>
-                            <withXml>true</withXml>
-                            <configOptions>
-                                <java8>true</java8>
-                                <springBootVersion>2.2.4-RELEASE</springBootVersion>
-                            </configOptions>
+       </dependencies>
 
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>io.swagger</groupId>
+                               <artifactId>swagger-codegen-maven-plugin</artifactId>
+                               <version>2.3.1</version>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>generate</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <output>target/generated-sources</output>
+                                                       <inputSpec>${project.basedir}/../model/src/main/resources/sli-api.20161110.yaml</inputSpec>
+                                                       <language>spring</language>
+                                                       <apiPackage>org.onap.ccsdk.sli.core.sliapi.springboot.controllers.swagger</apiPackage>
+                                                       <modelPackage>org.onap.ccsdk.sli.core.sliapi.model</modelPackage>
+                                                       <invokerPackage>org.onap.ccsdk.sli.core.sliapi.springboot.controllers.swagger</invokerPackage>
+                                                       <generateApis>true</generateApis>
+                                                       <generateApiTests>true</generateApiTests>
+                                                       <ignoreFileOverride>${project.basedir}/.swagger-codegen-ignore</ignoreFileOverride>
+                                                       <withXml>true</withXml>
+                                                       <configOptions>
+                                                               <java8>true</java8>
+                                                               <springBootVersion>2.2.4-RELEASE</springBootVersion>
+                                                       </configOptions>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               <plugin>
+                               <groupId>org.springframework.boot</groupId>
+                               <artifactId>spring-boot-maven-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>repackage</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
 </project>
diff --git a/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/App.java b/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/App.java
new file mode 100644 (file)
index 0000000..941c1d5
--- /dev/null
@@ -0,0 +1,12 @@
+package org.onap.ccsdk.sli.core.sliapi.springboot;\r
+\r
+import org.springframework.boot.SpringApplication;\r
+import org.springframework.boot.autoconfigure.SpringBootApplication;\r
+\r
+@SpringBootApplication\r
+public class App {\r
+\r
+  public static void main(String[] args) throws Exception {\r
+    SpringApplication.run(App.class, args);\r
+  }\r
+}\r
@@ -1,26 +1,19 @@
-package org.onap.ccsdk.sli.core.sliapi.springboot;
+package org.onap.ccsdk.sli.core.sliapi.springboot.controllers;
 
 import java.util.HashMap;
 import java.util.Map.Entry;
 import java.util.Properties;
-
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicLoader;
-import org.onap.ccsdk.sli.core.sli.provider.base.HashMapResolver;
-import org.onap.ccsdk.sli.core.sli.provider.base.InMemorySvcLogicStore;
-import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicResolver;
 import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceBase;
-import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceImplBase;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.boot.SpringApplication;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-
 import com.google.gson.Gson;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
@@ -30,7 +23,8 @@ import com.google.gson.JsonParser;
 @Controller
 @EnableAutoConfiguration
 public class ExecuteGraphController {
-       static SvcLogicServiceBase svc;
+  @Autowired
+  protected SvcLogicServiceBase svc;
        private static final Logger LOGGER = LoggerFactory.getLogger(ExecuteGraphController.class);
 
        @RequestMapping(value = "/executeGraph", method = RequestMethod.POST)
@@ -98,12 +92,5 @@ public class ExecuteGraphController {
                }
        }
 
-       public static void main(String[] args) throws Exception {
-               InMemorySvcLogicStore store = new InMemorySvcLogicStore();
-               SvcLogicLoader loader = new SvcLogicLoader(System.getProperty("serviceLogicDirectory"), store);
-               loader.loadAndActivate();
-               SvcLogicResolver resolver = new HashMapResolver();
-               svc = new SvcLogicServiceImplBase(store, resolver);
-               SpringApplication.run(ExecuteGraphController.class, args);
-       }
+
 }
@@ -1,25 +1,26 @@
-package org.onap.ccsdk.sli.core.sliapi.springboot;
+package org.onap.ccsdk.sli.core.sliapi.springboot.controllers.swagger;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.*;
-import org.onap.ccsdk.sli.core.sli.*;
-import org.onap.ccsdk.sli.core.sli.provider.base.*;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Properties;
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceBase;
 import org.onap.ccsdk.sli.core.sliapi.model.ExecuteGraphInput;
 import org.onap.ccsdk.sli.core.sliapi.model.ResponseFields;
+import org.onap.ccsdk.sli.core.sliapi.springboot.controllers.swagger.RestconfApi;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Properties;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.JsonObject;
 
 @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2020-02-20T12:50:11.207-05:00")
 
@@ -29,54 +30,14 @@ public class RestconfApiController implements RestconfApi {
        private final ObjectMapper objectMapper;
        private final HttpServletRequest request;
 
-
-       private static SvcLogicServiceBase svc;
+  @Autowired
+  protected SvcLogicServiceBase svc;
        private static final Logger log = LoggerFactory.getLogger(RestconfApiController.class);
 
        @org.springframework.beans.factory.annotation.Autowired
        public RestconfApiController(ObjectMapper objectMapper, HttpServletRequest request) {
                this.objectMapper = objectMapper;
                this.request = request;
-
-               SvcLogicPropertiesProvider propProvider = new SvcLogicPropertiesProvider() {
-
-                       @Override
-                       public Properties getProperties() {
-                               Properties props = new Properties();
-                               String propPath = "src/main/resources/svclogic.properties";
-                               System.out.println(propPath);
-                               try (FileInputStream fileInputStream = new FileInputStream(propPath)) {
-                                       props = new Properties();
-                                       props.load(fileInputStream);
-                               } catch (final IOException e) {
-                                       log.error("Failed to load properties for file: {}", propPath,
-                                                       new ConfigurationException("Failed to load properties for file: " + propPath, e));
-                               }
-                               return props;
-                       }
-               };
-
-               SvcLogicStore store = null;
-               try {
-                       store = SvcLogicStoreFactory.getSvcLogicStore(propProvider.getProperties());
-               } catch (SvcLogicException e) {
-                       log.error("Cannot create SvcLogicStore", e);
-                       return;
-               }
-
-               String serviceLogicDirectory = System.getProperty("serviceLogicDirectory", "src/main/resources");
-               System.out.println("serviceLogicDirectory is " + serviceLogicDirectory);
-               SvcLogicLoader loader = new SvcLogicLoader(serviceLogicDirectory, store);
-
-               try {
-                       loader.loadAndActivate();
-               } catch (IOException e) {
-                       log.error("Cannot load directed graphs", e);
-               }
-               SvcLogicResolver resolver = new HashMapResolver();
-
-               svc = new SvcLogicServiceImplBase(store, resolver);
-
        }
 
        @Override
diff --git a/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java b/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java
new file mode 100644 (file)
index 0000000..f39fc22
--- /dev/null
@@ -0,0 +1,71 @@
+package org.onap.ccsdk.sli.core.sliapi.springboot.core;\r
+\r
+import java.io.FileInputStream;\r
+import java.io.IOException;\r
+import java.util.Properties;\r
+import org.onap.ccsdk.sli.core.sli.ConfigurationException;\r
+import org.onap.ccsdk.sli.core.sli.SvcLogicLoader;\r
+import org.onap.ccsdk.sli.core.sli.SvcLogicStore;\r
+import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory;\r
+import org.onap.ccsdk.sli.core.sli.provider.base.HashMapResolver;\r
+import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicPropertiesProvider;\r
+import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicResolver;\r
+import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceBase;\r
+import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceImplBase;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+import org.springframework.context.annotation.Bean;\r
+import org.springframework.context.annotation.Configuration;\r
+\r
+@Configuration\r
+public class SvcLogicFactory {\r
+  private static final Logger log = LoggerFactory.getLogger(SvcLogicFactory.class);\r
+\r
+  @Bean\r
+  public SvcLogicStore getStore() throws Exception {\r
+    SvcLogicPropertiesProvider propProvider = new SvcLogicPropertiesProvider() {\r
+\r
+      @Override\r
+      public Properties getProperties() {\r
+        Properties props = new Properties();\r
+        String propPath = "src/main/resources/svclogic.properties";\r
+        System.out.println(propPath);\r
+        try (FileInputStream fileInputStream = new FileInputStream(propPath)) {\r
+          props = new Properties();\r
+          props.load(fileInputStream);\r
+        } catch (final IOException e) {\r
+          log.error("Failed to load properties for file: {}", propPath,\r
+              new ConfigurationException("Failed to load properties for file: " + propPath, e));\r
+        }\r
+        return props;\r
+      }\r
+    };\r
+    SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(propProvider.getProperties());\r
+    return store;\r
+  }\r
+\r
+  @Bean\r
+  public SvcLogicLoader createLoader() throws Exception {\r
+    String serviceLogicDirectory = System.getProperty("serviceLogicDirectory");\r
+    if (serviceLogicDirectory == null) {\r
+      serviceLogicDirectory = "src/main/resources";\r
+    }\r
+\r
+    System.out.println("serviceLogicDirectory is " + serviceLogicDirectory);\r
+    SvcLogicLoader loader = new SvcLogicLoader(serviceLogicDirectory, getStore());\r
+\r
+    try {\r
+      loader.loadAndActivate();\r
+    } catch (IOException e) {\r
+      log.error("Cannot load directed graphs", e);\r
+    }\r
+    return loader;\r
+  }\r
+\r
+  @Bean\r
+  public SvcLogicServiceBase createService() throws Exception {\r
+    SvcLogicResolver resolver = new HashMapResolver();\r
+    return new SvcLogicServiceImplBase(getStore(), resolver);\r
+  }\r
+\r
+}\r
index 64415bd..851488b 100644 (file)
@@ -1,8 +1,10 @@
 springfox.documentation.swagger.v2.path=/api-docs
 server.contextPath=/restconf
 server.port=8080
-spring.jackson.date-format=org.onap.ccsdk.sli.core.sliapi.springboot.RFC3339DateFormat
+spring.jackson.date-format=org.onap.ccsdk.sli.core.sliapi.springboot.controllers.swagger.RFC3339DateFormat
 spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
 spring.datasource.url=jdbc:derby:sdnctl;create=true
 spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyTenSevenDialect
 spring.jpa.hibernate.ddl-auto=update
+logging.level.com.att=TRACE
+logging.level.org.onap=TRACE
\ No newline at end of file
index 13f5939..e34d118 100644 (file)
@@ -1,7 +1,6 @@
 package org.onap.ccsdk.sli.core.sliapi.springboot;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import static org.junit.Assert.assertEquals;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.onap.ccsdk.sli.core.sliapi.model.ExecuteGraphInput;
@@ -10,94 +9,102 @@ import org.onap.ccsdk.sli.core.sliapi.model.ResponseFields;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.http.MediaType;
 import org.springframework.test.context.junit4.SpringRunner;
 import org.springframework.test.web.servlet.MockMvc;
 import org.springframework.test.web.servlet.MvcResult;
 import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-
-import static org.junit.Assert.assertEquals;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 @RunWith(SpringRunner.class)
-@WebMvcTest(RestconfApiController.class)
+@SpringBootTest
+@AutoConfigureMockMvc
 public class RestconfApiControllerTest {
 
+  private static final Logger log = LoggerFactory.getLogger(RestconfApiControllerTest.class);
 
-    private static final Logger log = LoggerFactory.getLogger(RestconfApiControllerTest.class);
-
-    @Autowired
-    private MockMvc mvc;
-
+  @Autowired
+  private MockMvc mvc;
 
-    @Test
-    public void testHealthcheck() throws Exception {
-        String url = "/restconf/operations/SLI-API:healthcheck";
+  @Test
+  public void testHealthcheck() throws Exception {
+    String url = "/restconf/operations/SLI-API:healthcheck";
 
-        MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content("")).andReturn();
+    MvcResult mvcResult =
+        mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content(""))
+            .andReturn();
 
-        assertEquals(200, mvcResult.getResponse().getStatus());
-    }
+    assertEquals(200, mvcResult.getResponse().getStatus());
+  }
 
-    @Test
-    public void testVlbcheck() throws Exception {
-        String url = "/restconf/operations/SLI-API:vlbcheck";
+  @Test
+  public void testVlbcheck() throws Exception {
+    String url = "/restconf/operations/SLI-API:vlbcheck";
 
-        MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content("")).andReturn();
+    MvcResult mvcResult =
+        mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content(""))
+            .andReturn();
 
-        assertEquals(200, mvcResult.getResponse().getStatus());
-    }
+    assertEquals(200, mvcResult.getResponse().getStatus());
+  }
 
-    @Test
-    public void testExecuteHealthcheck() throws Exception {
-        String url = "/restconf/operations/SLI-API:execute-graph";
+  @Test
+  public void testExecuteHealthcheck() throws Exception {
+    String url = "/restconf/operations/SLI-API:execute-graph";
 
-        ExecuteGraphInput executeGraphInput = new ExecuteGraphInput();
-        ExecutegraphinputInput executeGraphData = new ExecutegraphinputInput();
+    ExecuteGraphInput executeGraphInput = new ExecuteGraphInput();
+    ExecutegraphinputInput executeGraphData = new ExecutegraphinputInput();
 
-        executeGraphData.setModuleName("sli");
-        executeGraphData.setRpcName("healthcheck");
-        executeGraphData.setMode("sync");
-        executeGraphInput.setInput(executeGraphData);
+    executeGraphData.setModuleName("sli");
+    executeGraphData.setRpcName("healthcheck");
+    executeGraphData.setMode("sync");
+    executeGraphInput.setInput(executeGraphData);
 
-        String jsonString = mapToJson(executeGraphInput);
-        log.error("jsonString is {}", jsonString);
+    String jsonString = mapToJson(executeGraphInput);
+    log.error("jsonString is {}", jsonString);
 
-        MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content(jsonString)).andReturn();
+    MvcResult mvcResult =
+        mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content(jsonString))
+            .andReturn();
 
-        assertEquals(200, mvcResult.getResponse().getStatus());
+    assertEquals(200, mvcResult.getResponse().getStatus());
 
-    }
+  }
 
-    @Test
-    public void testExecuteMissingDg() throws Exception {
-        String url = "/restconf/operations/SLI-API:execute-graph";
+  @Test
+  public void testExecuteMissingDg() throws Exception {
+    String url = "/restconf/operations/SLI-API:execute-graph";
 
-        ExecuteGraphInput executeGraphInput = new ExecuteGraphInput();
-        ExecutegraphinputInput executeGraphData = new ExecutegraphinputInput();
+    ExecuteGraphInput executeGraphInput = new ExecuteGraphInput();
+    ExecutegraphinputInput executeGraphData = new ExecutegraphinputInput();
 
-        executeGraphData.setModuleName("sli");
-        executeGraphData.setRpcName("noSuchRPC");
-        executeGraphData.setMode("sync");
-        executeGraphInput.setInput(executeGraphData);
+    executeGraphData.setModuleName("sli");
+    executeGraphData.setRpcName("noSuchRPC");
+    executeGraphData.setMode("sync");
+    executeGraphInput.setInput(executeGraphData);
 
-        String jsonString = mapToJson(executeGraphInput);
+    String jsonString = mapToJson(executeGraphInput);
 
-        log.error("jsonString is {}", jsonString);
+    log.error("jsonString is {}", jsonString);
 
-        MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content(jsonString)).andReturn();
+    MvcResult mvcResult =
+        mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content(jsonString))
+            .andReturn();
 
-        assertEquals(401, mvcResult.getResponse().getStatus());
+    assertEquals(401, mvcResult.getResponse().getStatus());
 
-    }
+  }
 
-    private String mapToJson(Object obj) throws JsonProcessingException {
-        ObjectMapper objectMapper = new ObjectMapper();
-        return objectMapper.writeValueAsString(obj);
-    }
+  private String mapToJson(Object obj) throws JsonProcessingException {
+    ObjectMapper objectMapper = new ObjectMapper();
+    return objectMapper.writeValueAsString(obj);
+  }
 
-    private ResponseFields respFromJson(String jsonString) throws JsonProcessingException {
-        ObjectMapper objectMapper = new ObjectMapper();
-        return(objectMapper.readValue(jsonString, ResponseFields.class));
-    }
+  private ResponseFields respFromJson(String jsonString) throws JsonProcessingException {
+    ObjectMapper objectMapper = new ObjectMapper();
+    return (objectMapper.readValue(jsonString, ResponseFields.class));
+  }
 }