Search in sources :

Example 6 with TrackingDto

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);
}
Also used : TrackingDto(org.motechproject.mds.dto.TrackingDto)

Example 7 with 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;
}
Also used : TrackingDto(org.motechproject.mds.dto.TrackingDto)

Example 8 with TrackingDto

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());
}
Also used : EntityDto(org.motechproject.mds.dto.EntityDto) InvalidSecuritySample(org.motechproject.mds.annotations.internal.samples.InvalidSecuritySample) Sample(org.motechproject.mds.annotations.internal.samples.Sample) AnotherSample(org.motechproject.mds.annotations.internal.samples.AnotherSample) RelatedSample(org.motechproject.mds.annotations.internal.samples.RelatedSample) AnotherInvalidSecuritySample(org.motechproject.mds.annotations.internal.samples.AnotherInvalidSecuritySample) ReadAccessSample(org.motechproject.mds.annotations.internal.samples.ReadAccessSample) AdvancedSettingsDto(org.motechproject.mds.dto.AdvancedSettingsDto) TrackingDto(org.motechproject.mds.dto.TrackingDto) Test(org.junit.Test)

Aggregations

TrackingDto (org.motechproject.mds.dto.TrackingDto)8 Test (org.junit.Test)3 AdvancedSettingsDto (org.motechproject.mds.dto.AdvancedSettingsDto)3 EntityDto (org.motechproject.mds.dto.EntityDto)3 RestOptionsDto (org.motechproject.mds.dto.RestOptionsDto)2 Annotation (java.lang.annotation.Annotation)1 ArrayList (java.util.ArrayList)1 CtClass (javassist.CtClass)1 PersistenceManagerFactory (javax.jdo.PersistenceManagerFactory)1 NotPersistent (javax.jdo.annotations.NotPersistent)1 Entity (org.motechproject.mds.annotations.Entity)1 AnotherInvalidSecuritySample (org.motechproject.mds.annotations.internal.samples.AnotherInvalidSecuritySample)1 AnotherSample (org.motechproject.mds.annotations.internal.samples.AnotherSample)1 InvalidSecuritySample (org.motechproject.mds.annotations.internal.samples.InvalidSecuritySample)1 ReadAccessSample (org.motechproject.mds.annotations.internal.samples.ReadAccessSample)1 RelatedSample (org.motechproject.mds.annotations.internal.samples.RelatedSample)1 Sample (org.motechproject.mds.annotations.internal.samples.Sample)1 MdsEntity (org.motechproject.mds.domain.MdsEntity)1 MdsVersionedEntity (org.motechproject.mds.domain.MdsVersionedEntity)1 FieldDto (org.motechproject.mds.dto.FieldDto)1