X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineAPI%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Ftest%2FDeletePolicyConditionTest.java;h=7255f1c86c0f8853bce67acac889c2b5e32fe4b5;hb=5450bdbfb94fb5217617da6c41971fd26f7e81b5;hp=d59a1465871d0627a6e6c45270e170e61db4f9fd;hpb=a9710cb3b80c73c98d257c676ba6ecf9e30ef758;p=policy%2Fengine.git
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/test/DeletePolicyConditionTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/test/DeletePolicyConditionTest.java
index d59a14658..7255f1c86 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/test/DeletePolicyConditionTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/test/DeletePolicyConditionTest.java
@@ -26,73 +26,58 @@ import org.onap.policy.api.DeletePolicyCondition;
import static org.junit.Assert.*;
/**
- * The class DeletePolicyConditionTest
contains tests for the class {@link DeletePolicyCondition}
.
+ * The class DeletePolicyConditionTest
contains tests for the class
+ * {@link DeletePolicyCondition}
.
*
* @generatedBy CodePro at 6/1/16 1:41 PM
* @version $Revision: 1.0 $
*/
public class DeletePolicyConditionTest {
- /**
- * Run the String toString() method test.
- *
- * @throws Exception
- *
- * @generatedBy CodePro at 6/1/16 1:41 PM
- */
- @Test
- public void testToString_1()
- throws Exception {
- DeletePolicyCondition fixture = DeletePolicyCondition.ALL;
- String result = fixture.toString();
+ @Test
+ public void testToString_1() throws Exception {
+ final DeletePolicyCondition fixture = DeletePolicyCondition.ALL;
- // add additional test code here
- assertEquals("All Versions", result);
-
- assertEquals(DeletePolicyCondition.ALL, DeletePolicyCondition.create(DeletePolicyCondition.ALL.name()));
- }
+ final String result = fixture.toString();
- @Test(expected = IllegalArgumentException.class)
- public void testException() {
- DeletePolicyCondition.create("foobar");
- }
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- *
- * @generatedBy CodePro at 6/1/16 1:41 PM
- */
- @Before
- public void setUp()
- throws Exception {
- // add additional set up code here
- }
+ // add additional test code here
+ assertEquals("All Versions", result);
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
- * @generatedBy CodePro at 6/1/16 1:41 PM
- */
- @After
- public void tearDown()
- throws Exception {
- // Add additional tear down code here
- }
+ assertEquals(DeletePolicyCondition.ALL, DeletePolicyCondition.create(DeletePolicyCondition.ALL.name()));
+ }
- /**
- * Launch the test.
- *
- * @param args the command line arguments
- *
- * @generatedBy CodePro at 6/1/16 1:41 PM
- */
- public static void main(String[] args) {
- new org.junit.runner.JUnitCore().run(DeletePolicyConditionTest.class);
- }
+ @Test
+ public void testCreate_EnumName_DeletePolicyConditionEnum() {
+ for (final DeletePolicyCondition condition : DeletePolicyCondition.values()) {
+ final DeletePolicyCondition actualCondition = DeletePolicyCondition.create(condition.name());
+ assertEquals(condition, actualCondition);
+ assertEquals(condition.toString(), actualCondition.toString());
+ }
+ }
+
+ @Test
+ public void testCreate_StringValue_DeletePolicyConditionEnum() {
+ for (final DeletePolicyCondition condition : DeletePolicyCondition.values()) {
+ final DeletePolicyCondition actualCondition = DeletePolicyCondition.create(condition.toString());
+ assertEquals(condition, actualCondition);
+ }
+
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testException() {
+ DeletePolicyCondition.create("foobar");
+ }
+
+ /**
+ * Launch the test.
+ *
+ * @param args
+ * the command line arguments
+ *
+ * @generatedBy CodePro at 6/1/16 1:41 PM
+ */
+ public static void main(final String[] args) {
+ new org.junit.runner.JUnitCore().run(DeletePolicyConditionTest.class);
+ }
}