@Test
public void testParameterValuesWithEnumsOnly() throws Exception {

    Map<String, WorkDefinitionImpl> repoResults = WorkItemRepository.getWorkDefinitions(getClass().getResource("repository").toURI().toString());
    assertNotNull(repoResults);
    assertFalse(repoResults.isEmpty());
    assertEquals(repoResults.size(), 9);
    WorkDefinitionImpl testServiceWithParamValues = repoResults.get("TestServiceWithParamValues");
    assertNotNull(testServiceWithParamValues);
    assertNotNull(testServiceWithParamValues.getParameterValues());
    Map<String, Object> parameterValues = testServiceWithParamValues.getParameterValues();
    assertNotNull(parameterValues);
    assertEquals(parameterValues.size(), 2);
    for( Map.Entry<String, Object> entry : parameterValues.entrySet() ) {
        assertTrue( entry.getValue() instanceof  EnumDataType );
        if (entry.getKey().equals("param1")) {
            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")) {
            EnumDataType paramEnum = (EnumDataType) entry.getValue();
            assertEquals("org.jbpm.process.workitem.enums.CarsEnum", paramEnum.getClassName());
            Map<String, Object> paramValuesMap = paramEnum.getValueMap(null);
            assertNotNull(paramValuesMap);
            assertEquals(5, paramValuesMap.size());
            assertTrue(paramValuesMap.containsKey("HONDA"));
            assertTrue(paramValuesMap.containsKey("MAZDA"));
            assertTrue(paramValuesMap.containsKey("NISSAN"));
            assertTrue(paramValuesMap.containsKey("TOYOTA"));
            assertTrue(paramValuesMap.containsKey("FORD"));
            assertEquals(paramValuesMap.get("HONDA"), CarsEnum.HONDA);
            assertEquals(paramValuesMap.get("MAZDA"), CarsEnum.MAZDA);
            assertEquals(paramValuesMap.get("NISSAN"), CarsEnum.NISSAN);
            assertEquals(paramValuesMap.get("TOYOTA"), CarsEnum.TOYOTA);
            assertEquals(paramValuesMap.get("FORD"), CarsEnum.FORD);
        } else {
            fail("invalid parameter name");
        }
    }
}