EducationFormTypeParametersExtractor extends AbstractParametersExtractor<EducationFormType> { @Override public Map<String, Object> getParameters(final EducationFormType entity, final Map<String, Object> parameters) { addParameter(entity.getName(), "name", parameters); return parameters; }  @Override Map<String, Object> getParameters(final EducationFormType entity, final Map<String, Object> parameters);  }
@Test public void testGetParameters() throws Exception { String name = "AddressN"; EducationFormType entity = new EducationFormType(); entity.setName(name); Map<String, Object> expected = new HashMap<String, Object>(); expected.put("name", name); expected.put("status", RowStatus.ACTIVE); expected.put("userGroups", groups); Map<String, Object> actual = unit.getParameters(entity); assertEquals(expected, actual); }
@Test public void testGetParametersWithDisabledDEfaults() throws Exception { unit.setActive(false); unit.setSecurity(false); String name = "AddressN"; EducationFormType entity = new EducationFormType(); entity.setName(name); Map<String, Object> expected = new HashMap<String, Object>(); expected.put("name", name); Map<String, Object> actual = unit.getParameters(entity); assertEquals(expected, actual); }
@Test public void testGetParametersWithDefaultEntity() throws Exception { EducationFormType entity = new EducationFormType(); Map<String, Object> expected = new HashMap<String, Object>(); expected.put("status", RowStatus.ACTIVE); expected.put("userGroups", groups); Map<String, Object> actual = unit.getParameters(entity); assertEquals(expected, actual); }
@Test public void testGetParametersWithDefaultEntityAndDisabledSecurity() throws Exception { unit.setSecurity(false); EducationFormType entity = new EducationFormType(); Map<String, Object> expected = new HashMap<String, Object>(); expected.put("status", RowStatus.ACTIVE); Map<String, Object> actual = unit.getParameters(entity); assertEquals(expected, actual); }
@Test public void testGetParametersWithDefaultEntityAndDisabledStatus() throws Exception { unit.setActive(false); EducationFormType entity = new EducationFormType(); Map<String, Object> expected = new HashMap<String, Object>(); expected.put("userGroups", groups); Map<String, Object> actual = unit.getParameters(entity); assertEquals(expected, actual); }
@Test public void testGetParametersWithDefaultEntityAndDisabledDEfaults() throws Exception { unit.setActive(false); unit.setSecurity(false); EducationFormType entity = new EducationFormType(); Map<String, Object> expected = new HashMap<String, Object>(); Map<String, Object> actual = unit.getParameters(entity); assertEquals(expected, actual); }