* Copyright (C) 2019 Nokia Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* ===================================================================
*
*/
+
package org.onap.clamp.clds.sdc.controller.installer;
import com.google.gson.Gson;
private static JsonObject jsonObjectBlueprintWithoutProperties;
private static JsonObject jsonObjectBlueprintWithoutRelationships;
+ /**
+ * Method to load Blueprints before all test.
+ *
+ * @throws IOException
+ * In case of issues when opening the files
+ */
@BeforeClass
public static void loadBlueprints() throws IOException {
microServiceTheWholeBlueprintValid = ResourceFileUtil
.getResourceAsString("clds/single-microservice-fragment-without-name.yaml");
String microServiceBlueprintWithoutProperties = ResourceFileUtil
.getResourceAsString("clds/single-microservice-fragment-without-properties.yaml");
- String microServiceBlueprintWithoutRelationships = ResourceFileUtil
- .getResourceAsString("clds/single-microservice-fragment-without-relationships.yaml");
jsonObjectBlueprintValid = yamlToJson(microServiceBlueprintValid);
jsonObjectBlueprintWithoutName = yamlToJson(microServiceBlueprintWithoutName);
jsonObjectBlueprintWithoutProperties = yamlToJson(microServiceBlueprintWithoutProperties);
+
+ String microServiceBlueprintWithoutRelationships = ResourceFileUtil
+ .getResourceAsString("clds/single-microservice-fragment-without-relationships.yaml");
jsonObjectBlueprintWithoutRelationships = yamlToJson(microServiceBlueprintWithoutRelationships);
}
}
@Test
- public void fallBackToOneMicroServiceTCATest() {
- MicroService tcaMS = new MicroService(BlueprintParser.TCA, "onap.policies.monitoring.cdap.tca.hi.lo.app", "",
- "");
- List<MicroService> expected = Collections.singletonList(tcaMS);
+ public void fallBackToOneMicroServiceTcaTest() {
+ MicroService tcaMs = new MicroService(BlueprintParser.TCA,
+ "onap.policies.monitoring.cdap.tca.hi.lo.app", "", "");
+ List<MicroService> expected = Collections.singletonList(tcaMs);
List<MicroService> actual = new BlueprintParser().fallbackToOneMicroService(microServiceBlueprintOldStyleTCA);
Assert.assertEquals(expected, actual);
@Test
public void fallBackToOneMicroServiceHolmesTest() {
- MicroService holmesMS = new MicroService(BlueprintParser.HOLMES, "onap.policies.monitoring.cdap.tca.hi.lo.app",
- "", "");
+ MicroService holmesMs = new MicroService(BlueprintParser.HOLMES,
+ "onap.policies.monitoring.cdap.tca.hi.lo.app", "", "");
- List<MicroService> expected = Collections.singletonList(holmesMS);
+ List<MicroService> expected = Collections.singletonList(holmesMs);
List<MicroService> actual = new BlueprintParser()
.fallbackToOneMicroService(microServiceBlueprintOldStyleHolmes);