import java.util.Map;
import org.junit.Before;
import org.junit.Test;
+import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfValidationResult;
}
private ToscaServiceTemplate deserializeMonitoringInputYaml(String resourcePath)
- throws JsonSyntaxException, IOException {
+ throws Exception {
Yaml yaml = new Yaml();
String policyYaml = ResourceUtils.getResourceAsString(resourcePath);
Object yamlObject = yaml.load(policyYaml);
- String yamlAsJsonString = new Gson().toJson(yamlObject);
+ String yamlAsJsonString = new StandardCoder().encode(yamlObject);
ToscaServiceTemplate serviceTemplate = gson.fromJson(yamlAsJsonString, ToscaServiceTemplate.class);
return serviceTemplate;
}