use of org.motechproject.mds.dto.TrackingDto in project motech by motech.
the class Entity method updateTracking.
protected void updateTracking(AdvancedSettingsDto advancedSettings) {
TrackingDto trackingDto = advancedSettings.getTracking();
updateTracking(trackingDto);
}
use of org.motechproject.mds.dto.TrackingDto in project motech by motech.
the class Tracking method toDto.
public TrackingDto toDto() {
TrackingDto dto = new TrackingDto();
dto.setRecordHistory(recordHistory);
dto.setAllowCreateEvent(allowCreateEvent);
dto.setAllowUpdateEvent(allowUpdateEvent);
dto.setAllowDeleteEvent(allowDeleteEvent);
dto.setModifiedByUser(modifiedByUser);
dto.setNonEditable(nonEditable);
return dto;
}
use of org.motechproject.mds.dto.TrackingDto in project motech by motech.
the class EntityProcessorTest method shouldNotOverrideHistorySettingsIfModifiedByUser.
@Test
public void shouldNotOverrideHistorySettingsIfModifiedByUser() {
EntityDto existingEntity = new EntityDto(1L, Sample.class.getName());
TrackingDto existingTracking = new TrackingDto();
existingTracking.setModifiedByUser(true);
AdvancedSettingsDto existingAdvancedSettings = new AdvancedSettingsDto();
existingAdvancedSettings.setTracking(existingTracking);
when(schemaHolder.getEntityByClassName(Sample.class.getName())).thenReturn(existingEntity);
when(schemaHolder.getAdvancedSettings(Sample.class.getName())).thenReturn(existingAdvancedSettings);
when(crudEventsProcessor.getProcessingResult()).thenReturn(existingTracking);
processor.process(Sample.class);
EntityDto entity = processor.getProcessingResult().get(0).getEntityProcessingResult();
TrackingDto tracking = processor.getProcessingResult().get(0).getTrackingProcessingResult();
assertFalse(entity.isRecordHistory());
assertFalse(tracking.isRecordHistory());
}
Aggregations