* 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.
/**
* Test the other constructors, as {@link PojosTest} tests the other methods.
*/
-public class ToscaPolicyIdentifierOptVersionTest extends ToscaIdentifierTestBase<ToscaPolicyIdentifierOptVersion> {
+public class ToscaConceptIdentifierOptVersionTest extends ToscaIdentifierTestBase<ToscaConceptIdentifierOptVersion> {
- 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());
}