/** * @see ConceptService#saveConceptMapType(ConceptMapType) */ @Test public void saveConceptMapType_shouldUpdateAnExistingConceptMapType() { ConceptMapType mapType = Context.getConceptService().getConceptMapType(1); //sanity checks Assert.assertNull(mapType.getDateChanged()); Assert.assertNull(mapType.getChangedBy()); mapType.setName("random name"); mapType.setDescription("random description"); ConceptMapType editedMapType = Context.getConceptService().saveConceptMapType(mapType); Context.flushSession(); Assert.assertEquals("random name", editedMapType.getName()); Assert.assertEquals("random description", editedMapType.getDescription()); //date changed and changed by should have been updated Assert.assertNotNull(editedMapType.getDateChanged()); Assert.assertNotNull(editedMapType.getChangedBy()); }
@Test public void shouldGetAnConceptMapTypeByUuid() throws Exception { MockHttpServletRequest req = request(RequestMethod.GET, getURI() + "/" + getUuid()); SimpleObject result = deserialize(handle(req)); ConceptMapType conceptMapTypeType = service.getConceptMapTypeByUuid(getUuid()); assertEquals(conceptMapTypeType.getUuid(), PropertyUtils.getProperty(result, "uuid")); assertEquals(conceptMapTypeType.getName(), PropertyUtils.getProperty(result, "name")); assertEquals(conceptMapTypeType.isHidden(), PropertyUtils.getProperty(result, "isHidden")); assertEquals(conceptMapTypeType.getDescription(), PropertyUtils.getProperty(result, "description")); }
@Override public void validateDefaultRepresentation() throws Exception { super.validateDefaultRepresentation(); assertPropEquals("name", getObject().getName()); assertPropEquals("description", getObject().getDescription()); assertPropEquals("isHidden", getObject().getIsHidden()); assertPropEquals("retired", getObject().isRetired()); }
@Override public void validateFullRepresentation() throws Exception { super.validateFullRepresentation(); assertPropEquals("name", getObject().getName()); assertPropEquals("description", getObject().getDescription()); assertPropEquals("isHidden", getObject().getIsHidden()); assertPropEquals("retired", getObject().isRetired()); assertPropPresent("auditInfo"); }