* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.introspection.tools;
+import static junit.framework.TestCase.assertNotNull;
+import static org.eclipse.persistence.jpa.jpql.Assert.fail;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URI;
+
import org.junit.Before;
import org.junit.Test;
import org.onap.aai.AAISetup;
import org.onap.aai.introspection.exceptions.AAIUnknownObjectException;
import org.springframework.test.annotation.DirtiesContext;
-import java.net.URI;
-
-import static junit.framework.TestCase.assertNotNull;
-import static org.eclipse.persistence.jpa.jpql.Assert.fail;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
public class InjectKeysFromURITest extends AAISetup {
@Before
public void setup() {
- loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getDefaultVersion());
- issue = new Issue();
+ loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getDefaultVersion());
+ issue = new Issue();
}
+
@Test
public void testInjectKeysFromURIOfPserverIsNotResolved() throws AAIUnknownObjectException {
try {
ik = new InjectKeysFromURI(loader, new URI("/aai/v12/cloud-infrastructure/complexes"));
- }catch(Exception e) {
+ } catch (Exception e) {
fail("InjectKeys instantiation threw an exception");
}
Introspector pserver = loader.introspectorFromName("pserver");
- pserver.setValue("in-maint",false);
+ pserver.setValue("in-maint", false);
pserver.setValue("hostname", "pserver2");
assertNotNull("Unable to load the template introspector", pserver);
assertFalse("Unable to resolve the pserver in-maint issue", issueResolved);
assertEquals("Introspector didn't successfully modify the pserver in-maint", false,
- pserver.getValue("in-maint"));
+ pserver.getValue("in-maint"));
}
+
@Test
public void testInjectKeysFromURIOfPserverSuccessfullyResolved() throws AAIUnknownObjectException {
try {
ik = new InjectKeysFromURI(loader, new URI("/aai/v12/cloud-infrastructure/pservers/pserver/pserver1"));
- }catch(Exception e) {
+ } catch (Exception e) {
fail("InjectKeys instantiation threw an exception");
}