use of org.apache.nifi.minifi.commons.schema.ConfigSchema in project nifi-minifi by apache.
the class SchemaLoaderTest method testMinimalConfigV2Version.
@Test
public void testMinimalConfigV2Version() throws IOException, SchemaLoaderException {
Map<String, Object> yamlAsMap = SchemaLoader.loadYamlAsMap(SchemaLoaderTest.class.getClassLoader().getResourceAsStream("config-minimal-v2.yml"));
yamlAsMap.put(ConfigSchema.VERSION, ConfigSchema.CONFIG_VERSION);
ConfigSchema configSchema = SchemaLoader.loadConfigSchemaFromYaml(yamlAsMap);
validateMinimalConfigVersion1Parse(configSchema);
}
use of org.apache.nifi.minifi.commons.schema.ConfigSchema in project nifi-minifi by apache.
the class SchemaLoaderTest method testMinimalConfigV1Version.
@Test
public void testMinimalConfigV1Version() throws IOException, SchemaLoaderException {
Map<String, Object> yamlAsMap = SchemaLoader.loadYamlAsMap(SchemaLoaderTest.class.getClassLoader().getResourceAsStream("config-minimal.yml"));
yamlAsMap.put(ConfigSchema.VERSION, ConfigSchemaV1.CONFIG_VERSION);
ConfigSchema configSchema = SchemaLoader.loadConfigSchemaFromYaml(yamlAsMap);
validateMinimalConfigVersion1Parse(configSchema);
}
use of org.apache.nifi.minifi.commons.schema.ConfigSchema in project nifi-minifi by apache.
the class SchemaLoaderTest method testMinimalConfigV3Version.
@Test
public void testMinimalConfigV3Version() throws IOException, SchemaLoaderException {
Map<String, Object> yamlAsMap = SchemaLoader.loadYamlAsMap(SchemaLoaderTest.class.getClassLoader().getResourceAsStream("config-minimal-v3.yml"));
yamlAsMap.put(ConfigSchema.VERSION, ConfigSchema.CONFIG_VERSION);
ConfigSchema configSchema = SchemaLoader.loadConfigSchemaFromYaml(yamlAsMap);
validateMinimalConfigVersion1Parse(configSchema);
}
use of org.apache.nifi.minifi.commons.schema.ConfigSchema in project nifi-minifi by apache.
the class SchemaLoaderTest method testMinimalConfigNoVersion.
@Test
public void testMinimalConfigNoVersion() throws IOException, SchemaLoaderException {
ConfigSchema configSchema = SchemaLoader.loadConfigSchemaFromYaml(SchemaLoaderTest.class.getClassLoader().getResourceAsStream("config-minimal.yml"));
validateMinimalConfigVersion1Parse(configSchema);
}
use of org.apache.nifi.minifi.commons.schema.ConfigSchema in project nifi-minifi by apache.
the class ConnectionSchemaV1Test method testConnectionGeneratedIds.
@Test
public void testConnectionGeneratedIds() {
List<Map<String, Object>> listWithKeyValues = getListWithKeyValues(CommonPropertyKeys.NAME_KEY, "test", "test", "test_2", "test", "test_2");
ConfigSchema configSchema = new ConfigSchemaV1(Collections.singletonMap(CommonPropertyKeys.CONNECTIONS_KEY, listWithKeyValues)).convert();
assertMessageDoesNotExist(configSchema, ConfigSchema.FOUND_THE_FOLLOWING_DUPLICATE_CONNECTION_IDS);
List<ConnectionSchema> connections = configSchema.getProcessGroupSchema().getConnections();
assertEquals(5, connections.size());
// Generated unique ids
assertEquals("098f6bcd-4621-3373-8ade-4e832627b4f6", connections.get(0).getId());
assertEquals("098f6bcd-4621-3373-8ade-4e832627b4f7", connections.get(1).getId());
assertEquals("b9dacbc6-7962-39a9-9e45-394e2cf0dbf6", connections.get(2).getId());
assertEquals("098f6bcd-4621-3373-8ade-4e832627b4f8", connections.get(3).getId());
assertEquals("b9dacbc6-7962-39a9-9e45-394e2cf0dbf7", connections.get(4).getId());
}
Aggregations