Search in sources :

Example 11 with RestOptionsDto

use of org.motechproject.mds.dto.RestOptionsDto in project motech by motech.

the class MdsRestBundleIT method prepareFilteredEntity.

private void prepareFilteredEntity() throws IOException {
    EntityDto entityDto = new EntityDto(FILTERED_ENTITY_NAME);
    entityDto = entityService.createEntity(entityDto);
    FieldDto strField = new FieldDto(null, entityDto.getId(), TypeDto.STRING, new FieldBasicDto("strFieldDisp", "strField"), false, null);
    FieldDto intField = new FieldDto(null, entityDto.getId(), TypeDto.INTEGER, new FieldBasicDto("intFieldDisp", "intField"), false, null);
    entityService.addFields(entityDto, asList(strField, intField));
    RestOptionsDto restOptions = new RestOptionsDto(true, true, true, true, false);
    restOptions.setFieldNames(prepareFilteredRestFieldNames(entityService.getEntityFields(entityDto.getId())));
    entityService.updateRestOptions(entityDto.getId(), restOptions);
}
Also used : EntityDto(org.motechproject.mds.dto.EntityDto) FieldBasicDto(org.motechproject.mds.dto.FieldBasicDto) RestOptionsDto(org.motechproject.mds.dto.RestOptionsDto) LookupFieldDto(org.motechproject.mds.dto.LookupFieldDto) FieldDto(org.motechproject.mds.dto.FieldDto)

Aggregations

RestOptionsDto (org.motechproject.mds.dto.RestOptionsDto)11 FieldDto (org.motechproject.mds.dto.FieldDto)6 AdvancedSettingsDto (org.motechproject.mds.dto.AdvancedSettingsDto)5 EntityDto (org.motechproject.mds.dto.EntityDto)5 Test (org.junit.Test)4 LookupDto (org.motechproject.mds.dto.LookupDto)4 LookupFieldDto (org.motechproject.mds.dto.LookupFieldDto)4 ArrayList (java.util.ArrayList)2 FieldBasicDto (org.motechproject.mds.dto.FieldBasicDto)2 TrackingDto (org.motechproject.mds.dto.TrackingDto)2 Annotation (java.lang.annotation.Annotation)1 Method (java.lang.reflect.Method)1 Arrays.asList (java.util.Arrays.asList)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 NotPersistent (javax.jdo.annotations.NotPersistent)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 Before (org.junit.Before)1 Matchers.anyString (org.mockito.Matchers.anyString)1 Entity (org.motechproject.mds.annotations.Entity)1