public SchemaResponseAssert matches(SchemaContainerVersion version) { assertNotNull(version); assertNotNull(actual); Schema storedSchema = version.getSchema(); matches(storedSchema); SchemaContainer container = version.getSchemaContainer(); matches(container); return this; }
@Override public JsonObject toDocument(SchemaContainer container) { JsonObject document = new JsonObject(); document.put(NAME_KEY, container.getName()); document.put(DESCRIPTION_KEY, container.getLatestVersion().getSchema().getDescription()); addBasicReferences(document, container); addPermissionInfo(document, container); document.put(VERSION_KEY, generateVersion(container)); return document; }
/** * Add a new node index to the search database and construct the index name using the provided values. See * {@link NodeContainerEntry#composeIndexName(String, String, String, ContainerType)} for details. * * @param project * @param branch * @param version * @param type * @return Fluent API */ default SearchQueueBatch addNodeIndex(Project project, Branch branch, SchemaContainerVersion version, ContainerType type) { return createNodeIndex(project.getUuid(), branch.getUuid(), version.getUuid(), type, version.getSchema()); }
public static SchemaContainer mockSchemaContainer(String name, User user) { SchemaContainer container = mock(SchemaContainer.class); when(container.getName()).thenReturn(name); when(container.getUuid()).thenReturn(SCHEMA_VEHICLE_UUID); SchemaContainerVersion latestVersion = mock(SchemaContainerVersion.class); when(latestVersion.getSchemaContainer()).thenReturn(container); when(latestVersion.getSchema()).thenReturn(mockContentSchema()); when(latestVersion.getName()).thenReturn(name); when(container.getLatestVersion()).thenReturn(latestVersion); when(container.getCreator()).thenReturn(user); when(container.getCreationTimestamp()).thenReturn(TIMESTAMP_OLD); when(container.getEditor()).thenReturn(user); when(container.getLastEditedTimestamp()).thenReturn(TIMESTAMP_NEW); when(container.getRolesWithPerm(GraphPermission.READ_PERM)).thenReturn(createEmptyTraversal()); return container; }
private FilterField<NodeContent, ?> createFieldFilter(SchemaContainer schema) { return new MappedFilter<>(schema.getName(), "Filters by fields of the " + schema.getName() + " schema", FieldFilter.filter(context, schema.getLatestVersion().getSchema()), NodeContent::getContainer); } }
addSchema(document, container.getSchemaContainerVersion()); addFields(document, "fields", container, container.getSchemaContainerVersion().getSchema().getFields()); if (log.isTraceEnabled()) { String json = document.toString(); displayField.put("key", container.getSchemaContainerVersion().getSchema().getDisplayField()); displayField.put("value", container.getDisplayFieldValue()); document.put("displayField", displayField);
SchemaModel schema = containerVersion.getSchema(); JsonObject mapping = getMappingProvider().getMapping(schema, branch); JsonObject settings = schema.getElasticsearch();
for (SchemaContainer container : project.getSchemaContainerRoot().findAll()) { SchemaContainerVersion version = container.getLatestVersion(); Schema schema = version.getSchema(); Builder root = newObject();
return node.getSchemaContainer().getLatestVersion().getSchema().isContainer(); }));