@Test public void testValidateAtlasMappingFileHappyPath2() { AtlasMapping mapping = getAtlasMappingFullValid(); assertNotNull(mapping); validations.addAll(validationService.validateMapping(mapping)); assertFalse(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); assertFalse(validationHelper.hasInfos()); }
@Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceType()) { case SOURCE: Validators.DATASOURCE_SOURCE_URI.get().validate(ds.getUri(), validations, ds.getId()); break; case TARGET: Validators.DATASOURCE_TARGET_URI.get().validate(ds.getUri(), validations, ds.getId()); break; default: throw new IllegalArgumentException(String.format("Unknown DataSource type '%s'", ds.getDataSourceType())); } } validateFieldMappings(mapping.getMappings(), mapping.getLookupTables(), validations); return validations; }
DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceType()) { case SOURCE: Validators.DATASOURCE_SOURCE_URI.get().validate(ds.getUri(), validations, ds.getId()); break; case TARGET: Validators.DATASOURCE_TARGET_URI.get().validate(ds.getUri(), validations, ds.getId()); break; default: throw new IllegalArgumentException(String.format("Unknown DataSource type '%s'", ds.getDataSourceType())); } } validateFieldMappings(mapping.getMappings(), mapping.getLookupTables(), validations); return validations; } }
DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceType()) { case SOURCE: Validators.DATASOURCE_SOURCE_URI.get().validate(ds.getUri(), validations, ds.getId()); break; case TARGET: Validators.DATASOURCE_TARGET_URI.get().validate(ds.getUri(), validations, ds.getId()); break; default: throw new IllegalArgumentException(String.format("Unknown DataSource type '%s'", ds.getDataSourceType())); } } validateFieldMappings(mapping.getMappings(), mapping.getLookupTables(), validations); return validations; }  }
DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceType()) { case SOURCE: Validators.DATASOURCE_SOURCE_URI.get().validate(ds.getUri(), validations, ds.getId()); break; case TARGET: Validators.DATASOURCE_TARGET_URI.get().validate(ds.getUri(), validations, ds.getId()); break; default: throw new IllegalArgumentException(String.format("Unknown DataSource type '%s'", ds.getDataSourceType())); } } validateFieldMappings(mapping.getMappings(), mapping.getLookupTables(), validations); return validations; }  @Override List<Validation> validateMapping(AtlasMapping mapping); }
DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceType()) { case SOURCE: Validators.DATASOURCE_SOURCE_URI.get().validate(ds.getUri(), validations, ds.getId()); break; case TARGET: Validators.DATASOURCE_TARGET_URI.get().validate(ds.getUri(), validations, ds.getId()); break; default: throw new IllegalArgumentException(String.format("Unknown DataSource type '%s'", ds.getDataSourceType())); } } validateFieldMappings(mapping.getMappings(), mapping.getLookupTables(), validations); return validations; }  @Override List<Validation> validateMapping(AtlasMapping mapping);  }