diff options
Diffstat (limited to 'common-parameters/src/test/java/org/onap/policy/common/parameters/TestJsonInput.java')
-rw-r--r-- | common-parameters/src/test/java/org/onap/policy/common/parameters/TestJsonInput.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/common-parameters/src/test/java/org/onap/policy/common/parameters/TestJsonInput.java b/common-parameters/src/test/java/org/onap/policy/common/parameters/TestJsonInput.java index ae4dbd2c..abef5528 100644 --- a/common-parameters/src/test/java/org/onap/policy/common/parameters/TestJsonInput.java +++ b/common-parameters/src/test/java/org/onap/policy/common/parameters/TestJsonInput.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,16 +23,13 @@ package org.onap.policy.common.parameters; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import com.google.gson.Gson; import com.google.gson.GsonBuilder; - import java.io.FileReader; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; - import org.junit.Test; import org.onap.policy.common.parameters.testclasses.TestParametersL00; @@ -42,15 +40,10 @@ public class TestJsonInput { public void testJsonInput() throws IOException { TestParametersL00 testParameterGroup = null; - // Read the parameters - try { - // Read the parameters from JSON using Gson - final Gson gson = new GsonBuilder().create(); - testParameterGroup = gson.fromJson(new FileReader("src/test/resources/parameters/TestParameters.json"), - TestParametersL00.class); - } catch (final Exception e) { - fail("test should not throw an exception here: " + e.getMessage()); - } + // Read the parameters from JSON using Gson + final Gson gson = new GsonBuilder().create(); + testParameterGroup = gson.fromJson(new FileReader("src/test/resources/parameters/TestParameters.json"), + TestParametersL00.class); GroupValidationResult validationResult = testParameterGroup.validate(); assertTrue(validationResult.isValid()); |