X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Fxml%2Fgenerator%2Fmodel%2FTestWidget.java;h=d7fe4af37e0878134aacc8cc1784f2a8b5fdb1b3;hb=7fcc74469c941c1834cd02b54ff5ca88a53bf83b;hp=07b93b0c36f900941fb11d2d2a0b2c8bba72f1c8;hpb=08f6801fc93c4b39a8e870974100cd24ec9450a0;p=aai%2Fbabel.git diff --git a/src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java b/src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java index 07b93b0..d7fe4af 100644 --- a/src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java +++ b/src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 European Software Marketing Ltd. + * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2019 European Software Marketing Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,14 +26,11 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertThat; -import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.util.Collections; -import java.util.Properties; import org.junit.BeforeClass; import org.junit.Test; -import org.onap.aai.babel.xml.generator.data.WidgetConfigurationUtil; +import org.onap.aai.babel.util.ArtifactTestUtils; import org.onap.aai.babel.xml.generator.model.Widget.Type; import org.onap.aai.babel.xml.generator.types.ModelType; @@ -49,18 +46,12 @@ public class TestWidget { /** * Load the Widget to UUID mappings from the Artifact Generator properties. * - * @throws FileNotFoundException - * if the properties file is missing * @throws IOException * if the properties file is not loaded */ @BeforeClass - public static void setup() throws FileNotFoundException, IOException { - final Properties properties = new Properties(); - try (InputStream in = TestWidget.class.getClassLoader().getResourceAsStream("artifact-generator.properties")) { - properties.load(in); - } - WidgetConfigurationUtil.setConfig(properties); + public static void setup() throws IOException { + new ArtifactTestUtils().loadWidgetToUuidMappings(); } @Test @@ -87,7 +78,7 @@ public class TestWidget { public void testWidgetMethods() { Widget widget = new ServiceWidget(); assertThat(widget.getType(), is(ModelType.WIDGET)); - assertThat(widget.getWidgetId(), is("82194af1-3c2c-485a-8f44-420e22a9eaa4")); + assertThat(widget.getWidgetId(), is("service-instance-invariant-id")); assertThat(widget.addWidget(new TenantWidget()), is(true)); assertThat(widget.memberOf(null), is(false)); assertThat(widget.memberOf(Collections.emptyList()), is(false));