@Test
public void testParameterValuesWithStringsAndEnums() throws Exception {

    Map<String, WorkDefinitionImpl> repoResults = WorkItemRepository.getWorkDefinitions(getClass().getResource("repository").toURI().toString());
    assertNotNull(repoResults);
    assertFalse(repoResults.isEmpty());
    assertEquals(repoResults.size(), 9);
    WorkDefinitionImpl testServiceWithParamValuesThree = repoResults.get("TestServiceWithParamValuesThree");
    assertNotNull(testServiceWithParamValuesThree);
    assertNotNull(testServiceWithParamValuesThree.getParameterValues());
    Map<String, Object> parameterValues = testServiceWithParamValuesThree.getParameterValues();
    assertNotNull(parameterValues);
    assertEquals(parameterValues.size(), 2);
    /**
     *  "parameterValues" : [
     "param1" : new EnumDataType("org.jbpm.process.workitem.enums.AnimalsEnum"),
     "param3" : "one, two, three"
     ],
     */
    for( Map.Entry<String, Object> entry : parameterValues.entrySet() ) {
        assertNotNull( entry.getValue());
        if (entry.getKey().equals("param1")) {
            assertTrue( entry.getValue() instanceof  EnumDataType );
            EnumDataType paramEnum = (EnumDataType) entry.getValue();
            assertEquals("org.jbpm.process.workitem.enums.AnimalsEnum", paramEnum.getClassName());
            Map<String, Object> paramValuesMap = paramEnum.getValueMap(null);
            assertNotNull(paramValuesMap);
            assertEquals(5, paramValuesMap.size());
            assertTrue(paramValuesMap.containsKey("DOGS"));
            assertTrue(paramValuesMap.containsKey("CATS"));
            assertTrue(paramValuesMap.containsKey("ELEPHANTS"));
            assertTrue(paramValuesMap.containsKey("GIRAFFES"));
            assertTrue(paramValuesMap.containsKey("BIRDS"));
            assertEquals(paramValuesMap.get("DOGS"), AnimalsEnum.DOGS);
            assertEquals(paramValuesMap.get("CATS"), AnimalsEnum.CATS);
            assertEquals(paramValuesMap.get("ELEPHANTS"), AnimalsEnum.ELEPHANTS);
            assertEquals(paramValuesMap.get("GIRAFFES"), AnimalsEnum.GIRAFFES);
            assertEquals(paramValuesMap.get("BIRDS"), AnimalsEnum.BIRDS);
        } else if(entry.getKey().equals("param3")) {
            assertTrue( entry.getValue() instanceof  String );
            String paramValue = (String) entry.getValue();
            List<String> paramValueList = Arrays.asList(paramValue.split(","));
            assertNotNull(paramValueList);
            assertEquals(3, paramValueList.size());
            assertTrue(paramValueList.contains("one"));
            assertTrue(paramValueList.contains("two"));
            assertTrue(paramValueList.contains("three"));
        } else {
            fail("invalid parameter name");
        }
    }
}