Merge "Add .gitignore for swagger"
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / parsers / uri / URIParserTest.java
index bc3a684..42cfd92 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 package org.onap.aai.parsers.uri;
 
@@ -27,10 +25,10 @@ import org.junit.rules.ExpectedException;
 import org.onap.aai.AAISetup;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.introspection.Loader;
-import org.onap.aai.introspection.LoaderFactory;
 import org.onap.aai.introspection.ModelType;
-import org.onap.aai.introspection.Version;
+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;
@@ -41,7 +39,7 @@ import static org.hamcrest.Matchers.is;
 
 public class URIParserTest extends AAISetup {
 
-       private Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v8);
+       private Loader loader ;
 
        @Rule
        public ExpectedException thrown = ExpectedException.none();
@@ -54,12 +52,17 @@ public class URIParserTest extends AAISetup {
         * @throws IllegalArgumentException the illegal argument exception
         * @throws UnsupportedEncodingException the unsupported encoding exception
         */
+       @PostConstruct
+       public void createLoader(){
+               loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, new SchemaVersion("v10"));
+       }
+
        @Test
     public void invalidPath() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException {
                URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/network/tenants/tenant/key1/vservers/vserver/key2/l-interfaces/l-interface/key3").build();
                
                thrown.expect(AAIException.class);
-               thrown.expect(hasProperty("code",  is("AAI_3000")));
+               thrown.expect(hasProperty("code",  is("AAI_3001")));
                
                new URIToDBKey(loader, uri);
        }