X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-tosca%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Ftosca%2Fauthorative%2Fconcepts%2FToscaConceptIdentifierOptVersionTest.java;fp=models-tosca%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Ftosca%2Fauthorative%2Fconcepts%2FToscaPolicyIdentifierOptVersionTest.java;h=aedf5cb1511bc9c8be0175250dd4e4a38babea2a;hb=f2b0318f53abf9f2345a5cdca74f3dd635aa9b60;hp=0b43173ad269b5ee446a13176f1737b818aa4e07;hpb=8ad3f95cdcec48b8315a5febfd4ec07bae7aabba;p=policy%2Fmodels.git diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersionTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaConceptIdentifierOptVersionTest.java similarity index 66% rename from models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersionTest.java rename to models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaConceptIdentifierOptVersionTest.java index 0b43173ad..aedf5cb15 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersionTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaConceptIdentifierOptVersionTest.java @@ -3,6 +3,7 @@ * ONAP Policy Models * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,58 +29,58 @@ import org.junit.Test; /** * Test the other constructors, as {@link PojosTest} tests the other methods. */ -public class ToscaPolicyIdentifierOptVersionTest extends ToscaIdentifierTestBase { +public class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBase { - public ToscaPolicyIdentifierOptVersionTest() { - super(ToscaPolicyIdentifierOptVersion.class, "policy-id", "policy-version"); + public ToscaConceptIdentifierOptVersionTest() { + super(ToscaConceptIdentifierOptVersion.class, "name", "version"); } @Test public void testAllArgsConstructor_testIsNullVersion() { - assertThatThrownBy(() -> new ToscaPolicyIdentifierOptVersion(null, VERSION)) + assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion(null, VERSION)) .isInstanceOf(NullPointerException.class); // with null version - ToscaPolicyIdentifierOptVersion orig = new ToscaPolicyIdentifierOptVersion(NAME, null); + ToscaConceptIdentifierOptVersion orig = new ToscaConceptIdentifierOptVersion(NAME, null); assertEquals(NAME, orig.getName()); assertEquals(null, orig.getVersion()); - orig = new ToscaPolicyIdentifierOptVersion(NAME, VERSION); + orig = new ToscaConceptIdentifierOptVersion(NAME, VERSION); assertEquals(NAME, orig.getName()); assertEquals(VERSION, orig.getVersion()); } @Test public void testCopyConstructor() throws Exception { - assertThatThrownBy(() -> new ToscaPolicyIdentifierOptVersion((ToscaPolicyIdentifierOptVersion) null)) + assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion((ToscaConceptIdentifierOptVersion) null)) .isInstanceOf(NullPointerException.class); - ToscaPolicyIdentifierOptVersion orig = new ToscaPolicyIdentifierOptVersion(); + ToscaConceptIdentifierOptVersion orig = new ToscaConceptIdentifierOptVersion(); // verify with null values - assertEquals(orig.toString(), new ToscaPolicyIdentifierOptVersion(orig).toString()); + assertEquals(orig.toString(), new ToscaConceptIdentifierOptVersion(orig).toString()); // verify with all values orig = makeIdent(NAME, VERSION); - assertEquals(orig.toString(), new ToscaPolicyIdentifierOptVersion(orig).toString()); + assertEquals(orig.toString(), new ToscaConceptIdentifierOptVersion(orig).toString()); } @Test public void testCopyToscaPolicyIdentifierConstructor() { - assertThatThrownBy(() -> new ToscaPolicyIdentifierOptVersion((ToscaPolicyIdentifier) null)) + assertThatThrownBy(() -> new ToscaConceptIdentifierOptVersion((ToscaConceptIdentifier) null)) .isInstanceOf(NullPointerException.class); - ToscaPolicyIdentifier orig = new ToscaPolicyIdentifier(); + ToscaConceptIdentifier orig = new ToscaConceptIdentifier(); // verify with null values - ToscaPolicyIdentifierOptVersion newIdent = new ToscaPolicyIdentifierOptVersion(orig); + ToscaConceptIdentifierOptVersion newIdent = new ToscaConceptIdentifierOptVersion(orig); assertEquals(null, newIdent.getName()); assertEquals(null, newIdent.getVersion()); // verify with all values orig.setName(NAME); orig.setVersion(VERSION); - newIdent = new ToscaPolicyIdentifierOptVersion(orig); + newIdent = new ToscaConceptIdentifierOptVersion(orig); assertEquals(NAME, newIdent.getName()); assertEquals(VERSION, newIdent.getVersion()); }