Integrate aai-schema-ingest library into aai-core
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / introspection / PropertyPredicatesTest.java
index 0250bbb..72b5d31 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.
  * 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.introspection;
 
 import org.junit.Before;
+
 import org.junit.Test;
 import org.onap.aai.AAISetup;
 import org.onap.aai.introspection.exceptions.AAIUnknownObjectException;
@@ -34,42 +33,40 @@ import static org.junit.Assert.assertThat;
 
 public class PropertyPredicatesTest extends AAISetup {
 
-       private final Version version = Version.getLatest();
-
        private Loader loader;
        private ModelType introspectorFactoryType = ModelType.MOXY;
        private Introspector obj;
        
        @Before
        public void setup() throws Exception {
-               loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version);
-               obj = loader.introspectorFromName("test-object");
+               loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, schemaVersions.getDefaultVersion());
+               obj = loader.introspectorFromName("generic-vnf");
        }
        
        @Test
        public void includeInTestGeneration() throws AAIUnknownObjectException {
                
                Set<String> props = obj.getProperties(PropertyPredicates.includeInTestGeneration());
-               
-               assertThat("props not found", props, 
-                               not(hasItems("persona-model-ver", "not-visible-test-element", "model-invariant-id", "model-version-id")));
+
+               assertThat("props not found", props,
+                               not(hasItems("model-invariant-id", "model-version-id")));
        }
        
        @Test
        public void isVisible() throws AAIUnknownObjectException {
                
                Set<String> props = obj.getProperties(PropertyPredicates.isVisible());
-               
-               assertThat("props not found", props, not(hasItems("persona-model-ver")));
+
+               assertThat("props not found", props, hasItems("model-invariant-id", "model-version-id"));
        }
        
        @Test
        public void all() throws AAIUnknownObjectException {
                
                Set<String> props = obj.getProperties();
-               
-               assertThat("all found", props, hasItems("persona-model-ver", "not-visible-test-element"));
+
+               assertThat("all found", props, hasItems("model-invariant-id", "model-version-id"));
        }
        
-       
+
 }