AAI-1523 Batch reformat aai-core
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / parsers / uri / URIToExtensionInformationTest.java
index cb365bb..7d7d284 100644 (file)
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.parsers.uri;
 
+import static org.junit.Assert.assertEquals;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+
+import javax.annotation.PostConstruct;
+import javax.ws.rs.core.UriBuilder;
+import javax.xml.bind.JAXBException;
+
 import org.junit.Test;
 import org.onap.aai.AAISetup;
 import org.onap.aai.exceptions.AAIException;
@@ -27,19 +37,10 @@ import org.onap.aai.introspection.ModelType;
 import org.onap.aai.restcore.HttpMethod;
 import org.onap.aai.setup.SchemaVersion;
 
-import javax.annotation.PostConstruct;
-import javax.ws.rs.core.UriBuilder;
-import javax.xml.bind.JAXBException;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-
-import static org.junit.Assert.assertEquals;
-
 public class URIToExtensionInformationTest extends AAISetup {
 
-    
-    private Loader specificLoader ;
-    
+    private Loader specificLoader;
+
     /**
      * Vservers V 7.
      *
@@ -48,20 +49,25 @@ public class URIToExtensionInformationTest extends AAISetup {
      * @throws IllegalArgumentException the illegal argument exception
      * @throws UnsupportedEncodingException the unsupported encoding exception
      */
-    
+
     @PostConstruct
-    public void createLoader(){
+    public void createLoader() {
         specificLoader = loaderFactory.createLoaderForVersion(ModelType.MOXY, new SchemaVersion("v10"));
     }
-    
+
     @Test
-    public void vserversV8() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException {
-        URI uri = UriBuilder.fromPath("/aai/" + specificLoader.getVersion() + "/cloud-infrastructure/cloud-regions/cloud-region/testOwner1/testRegion1/tenants/tenant/key1/vservers/vserver/key2").build();
+    public void vserversV8()
+            throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException {
+        URI uri = UriBuilder.fromPath("/aai/" + specificLoader.getVersion()
+                + "/cloud-infrastructure/cloud-regions/cloud-region/testOwner1/testRegion1/tenants/tenant/key1/vservers/vserver/key2")
+                .build();
         URIToExtensionInformation parse = new URIToExtensionInformation(specificLoader, uri);
-        
+
         String namespace = "cloudInfrastructure";
-        String preMethodName = "DynamicAddCloudInfrastructureCloudRegionsCloudRegionTenantsTenantVserversVserverPreProc";
-        String postMethodName = "DynamicAddCloudInfrastructureCloudRegionsCloudRegionTenantsTenantVserversVserverPostProc";
+        String preMethodName =
+                "DynamicAddCloudInfrastructureCloudRegionsCloudRegionTenantsTenantVserversVserverPreProc";
+        String postMethodName =
+                "DynamicAddCloudInfrastructureCloudRegionsCloudRegionTenantsTenantVserversVserverPostProc";
         String topLevel = "CloudRegion";
         testSpec(parse, HttpMethod.PUT, namespace, preMethodName, postMethodName, topLevel);
 
@@ -77,12 +83,12 @@ public class URIToExtensionInformationTest extends AAISetup {
      * @param postMethodName the post method name
      * @param topLevel the top level
      */
-    private void testSpec(URIToExtensionInformation info, HttpMethod httpMethod, String namespace, String preMethodName, String postMethodName, String topLevel) {
-        
+    private void testSpec(URIToExtensionInformation info, HttpMethod httpMethod, String namespace, String preMethodName,
+            String postMethodName, String topLevel) {
 
         String namespaceResult = info.getNamespace();
         String methodNameResult = info.getMethodName(httpMethod, true);
-        
+
         assertEquals("namespace", namespace, namespaceResult);
         assertEquals("preprocess method name", preMethodName, methodNameResult);
         methodNameResult = info.getMethodName(httpMethod, false);
@@ -90,9 +96,8 @@ public class URIToExtensionInformationTest extends AAISetup {
         assertEquals("postprocess method name", postMethodName, methodNameResult);
 
         String topLevelResult = info.getTopObject();
-        
+
         assertEquals("topLevel", topLevel, topLevelResult);
     }
-    
-    
+
 }