public SchemaUpdateRequest toUpdateRequest() { SchemaUpdateRequest updateRequest = new SchemaUpdateRequest(); updateRequest.setContainer(isContainer()); updateRequest.getFields().addAll(getFields()); updateRequest.setName(getName()); updateRequest.setSegmentField(getSegmentField()); updateRequest.setDisplayField(getDisplayField()); updateRequest.setDescription(getDescription()); updateRequest.setElasticsearch(getElasticsearch()); updateRequest.setUrlFields(getUrlFields()); return updateRequest; }
public SchemaResponseAssert isValid() { actual.validate(); return this; }
public SchemaResponseAssert matches(Schema schema) { assertNotNull(schema); assertNotNull(actual); assertEquals("The name of the schemas do not match.", actual.getName(), schema.getName()); assertEquals("The description of the schemas do not match.", actual.getDescription(), schema.getDescription()); assertEquals("The displayField of the schemas do not match.", actual.getDisplayField(), schema.getDisplayField()); assertEquals("The segmentField of the schemas do not match.", actual.getSegmentField(), schema.getSegmentField()); // TODO assert for schema properties return this; }
public SchemaResponse getSchemaResponse() { SchemaResponse schema = new SchemaResponse(); schema.setUuid(UUID_1); schema.setDescription("Example schema description"); schema.setName("ExampleSchema"); schema.setSegmentField("name"); schema.setDisplayField("name"); schema.setPermissions(READ, UPDATE, DELETE, CREATE); schema.addField(nameFieldSchema); schema.addField(numberFieldSchema); schema.addField(htmlFieldSchema); listFieldSchema.setListType("node"); listFieldSchema.setName("list"); schema.addField(listFieldSchema); schema.addField(nodeFieldSchema); micronodeFieldSchema.setLabel("Location"); micronodeFieldSchema.setAllowedMicroSchemas(new String[] { "geolocation" }); schema.addField(micronodeFieldSchema); micronodeListFieldSchema.setListType("micronode"); micronodeListFieldSchema.setAllowedSchemas(new String[] { "geolocation" }); schema.addField(micronodeListFieldSchema); schema.validate();
/** * Create a schema reference using the schema as source. * * @return */ public SchemaReferenceImpl toReference() { SchemaReferenceImpl reference = new SchemaReferenceImpl(); reference.setUuid(getUuid()); reference.setVersion(getVersion()); reference.setName(getName()); return reference; }
public SchemaResponseAssert matches(SchemaContainer schema) { // TODO make schemas extends generic nodes? // assertGenericNode(schema, restSchema); assertNotNull(schema); assertNotNull(actual); String creatorUuid = schema.getCreator().getUuid(); String editorUuid = schema.getEditor().getUuid(); assertEquals("The editor of the schema did not match up.", editorUuid, actual.getEditor().getUuid()); assertEquals("The creator of the schema did not match up.", creatorUuid, actual.getCreator().getUuid()); assertEquals("The creation date did not match up", schema.getCreationDate(), actual.getCreated()); assertEquals("The edited date did not match up", schema.getLastEditedDate(), actual.getEdited()); // assertEquals("Name does not match with the requested name.", schema.getName(), restSchema.getName()); // assertEquals("Description does not match with the requested description.", schema.getDescription(), restSchema.getDescription()); // assertEquals("Display names do not match.", schema.getDisplayName(), restSchema.getDisplayName()); // TODO verify other fields return this; }
public SchemaCreateRequestAssert matches(SchemaResponse response) { assertNotNull(response); assertNotNull(actual); assertEquals("The name of the schemas do not match.", actual.getName(), response.getName()); assertEquals("The description of the schemas do not match.", actual.getDescription(), response.getDescription()); assertEquals("The displayField of the schemas do not match.", actual.getDisplayField(), response.getDisplayField()); assertEquals("The segmentField of the schemas do not match.", actual.getSegmentField(), response.getSegmentField()); // TODO assert for schema properties return this; }