diff --git a/bin/openmetadata-server-start.sh b/bin/openmetadata-server-start.sh index 01d2d033fcb..eb0d119f150 100644 --- a/bin/openmetadata-server-start.sh +++ b/bin/openmetadata-server-start.sh @@ -110,7 +110,7 @@ if [ -z "$OPENMETADATA_JVM_PERFORMANCE_OPTS" ]; then fi #Application classname -APP_CLASS="org.openmetadata.service.CatalogApplication" +APP_CLASS="org.openmetadata.service.OpenMetadataApplication" # Launch mode if [ "x$DAEMON_MODE" = "xtrue" ]; then diff --git a/bin/openmetadata.sh b/bin/openmetadata.sh index 364c96036fb..55321c93eaa 100644 --- a/bin/openmetadata.sh +++ b/bin/openmetadata.sh @@ -30,7 +30,7 @@ function catalogStart { if [[ $? -eq 0 ]]; then rm -f ${PID_FILE} echo "Starting OpenMetadata" - APP_CLASS="org.openmetadata.service.CatalogApplication" + APP_CLASS="org.openmetadata.service.OpenMetadataApplication" cd ${CATALOG_HOME} nohup ${JAVA} ${CATALOG_HEAP_OPTS} ${CATALOG_JVM_PERF_OPTS} ${CATALOG_DEBUG_OPTS} ${CATALOG_GC_LOG_OPTS} ${CATALOG_JMX_OPTS} -cp ${CLASSPATH} "${APP_CLASS}" "server" "$@" 2>>"${ERR_FILE}" 1>>"${OUT_FILE}" & cd - &> /dev/null diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/CatalogApplication.java b/openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java similarity index 92% rename from openmetadata-service/src/main/java/org/openmetadata/service/CatalogApplication.java rename to openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java index ab30fe1e450..a5de994deba 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/CatalogApplication.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java @@ -87,11 +87,11 @@ import org.openmetadata.service.socket.WebSocketManager; /** Main catalog application */ @Slf4j -public class CatalogApplication extends Application { +public class OpenMetadataApplication extends Application { private Authorizer authorizer; @Override - public void run(CatalogApplicationConfig catalogConfig, Environment environment) + public void run(OpenMetadataApplicationConfig catalogConfig, Environment environment) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException, IOException { final Jdbi jdbi = createAndSetupJDBI(environment, catalogConfig.getDataSourceFactory()); @@ -182,14 +182,15 @@ public class CatalogApplication extends Application { @SneakyThrows @Override - public void initialize(Bootstrap bootstrap) { + public void initialize(Bootstrap bootstrap) { bootstrap.setConfigurationSourceProvider( new SubstitutingSourceProvider( bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false))); bootstrap.addBundle( new SwaggerBundle<>() { @Override - protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(CatalogApplicationConfig catalogConfig) { + protected SwaggerBundleConfiguration getSwaggerBundleConfiguration( + OpenMetadataApplicationConfig catalogConfig) { return catalogConfig.getSwaggerBundleConfig(); } }); @@ -197,7 +198,7 @@ public class CatalogApplication extends Application { bootstrap.addBundle( new HealthCheckBundle<>() { @Override - protected HealthConfiguration getHealthConfiguration(final CatalogApplicationConfig configuration) { + protected HealthConfiguration getHealthConfiguration(final OpenMetadataApplicationConfig configuration) { return configuration.getHealthConfiguration(); } }); @@ -223,7 +224,7 @@ public class CatalogApplication extends Application { } } - private void registerAuthorizer(CatalogApplicationConfig catalogConfig, Environment environment) + private void registerAuthorizer(OpenMetadataApplicationConfig catalogConfig, Environment environment) throws NoSuchMethodException, ClassNotFoundException, IllegalAccessException, InvocationTargetException, InstantiationException { AuthorizerConfiguration authorizerConf = catalogConfig.getAuthorizerConfiguration(); @@ -251,24 +252,24 @@ public class CatalogApplication extends Application { } } - private void registerEventFilter(CatalogApplicationConfig catalogConfig, Environment environment, Jdbi jdbi) { + private void registerEventFilter(OpenMetadataApplicationConfig catalogConfig, Environment environment, Jdbi jdbi) { if (catalogConfig.getEventHandlerConfiguration() != null) { ContainerResponseFilter eventFilter = new EventFilter(catalogConfig, jdbi); environment.jersey().register(eventFilter); } } - private void registerEventPublisher(CatalogApplicationConfig catalogApplicationConfig) { + private void registerEventPublisher(OpenMetadataApplicationConfig openMetadataApplicationConfig) { // register ElasticSearch Event publisher - if (catalogApplicationConfig.getElasticSearchConfiguration() != null) { + if (openMetadataApplicationConfig.getElasticSearchConfiguration() != null) { ElasticSearchEventPublisher elasticSearchEventPublisher = - new ElasticSearchEventPublisher(catalogApplicationConfig.getElasticSearchConfiguration()); + new ElasticSearchEventPublisher(openMetadataApplicationConfig.getElasticSearchConfiguration()); EventPubSub.addEventHandler(elasticSearchEventPublisher); } } private void registerResources( - CatalogApplicationConfig config, Environment environment, Jdbi jdbi, SecretsManager secretsManager) { + OpenMetadataApplicationConfig config, Environment environment, Jdbi jdbi, SecretsManager secretsManager) { CollectionRegistry.getInstance().registerResources(jdbi, environment, config, authorizer, secretsManager); if (config.getElasticSearchConfiguration() != null) { environment.jersey().register(new SearchResource(config.getElasticSearchConfiguration())); @@ -279,7 +280,7 @@ public class CatalogApplication extends Application { environment.getApplicationContext().setErrorHandler(eph); } - private void intializeWebsockets(CatalogApplicationConfig catalogConfig, Environment environment) { + private void intializeWebsockets(OpenMetadataApplicationConfig catalogConfig, Environment environment) { SocketAddressFilter socketAddressFilter; String pathSpec = "/api/v1/push/feed/*"; if (catalogConfig.getAuthorizerConfiguration() != null) { @@ -312,8 +313,8 @@ public class CatalogApplication extends Application { } public static void main(String[] args) throws Exception { - CatalogApplication catalogApplication = new CatalogApplication(); - catalogApplication.run(args); + OpenMetadataApplication OpenMetadataApplication = new OpenMetadataApplication(); + OpenMetadataApplication.run(args); } public static class ManagedShutdown implements Managed { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/CatalogApplicationConfig.java b/openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplicationConfig.java similarity index 98% rename from openmetadata-service/src/main/java/org/openmetadata/service/CatalogApplicationConfig.java rename to openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplicationConfig.java index c48a85b86cd..b025a807c1e 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/CatalogApplicationConfig.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplicationConfig.java @@ -36,7 +36,7 @@ import org.openmetadata.service.validators.AirflowConfigValidation; @Getter @Setter -public class CatalogApplicationConfig extends Configuration { +public class OpenMetadataApplicationConfig extends Configuration { @JsonProperty("database") @NotNull @Valid diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/events/AuditEventHandler.java b/openmetadata-service/src/main/java/org/openmetadata/service/events/AuditEventHandler.java index 118bbac6251..86afdf13b98 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/events/AuditEventHandler.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/events/AuditEventHandler.java @@ -20,7 +20,7 @@ import org.jdbi.v3.core.Jdbi; import org.openmetadata.schema.EntityInterface; import org.openmetadata.schema.type.AuditLog; import org.openmetadata.schema.type.EntityReference; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.slf4j.Marker; import org.slf4j.MarkerFactory; @@ -28,7 +28,7 @@ import org.slf4j.MarkerFactory; public class AuditEventHandler implements EventHandler { private final Marker auditMarker = MarkerFactory.getMarker("AUDIT"); - public void init(CatalogApplicationConfig config, Jdbi jdbi) { + public void init(OpenMetadataApplicationConfig config, Jdbi jdbi) { // Nothing to do } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/events/ChangeEventHandler.java b/openmetadata-service/src/main/java/org/openmetadata/service/events/ChangeEventHandler.java index 7e515eafa27..75490626ea5 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/events/ChangeEventHandler.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/events/ChangeEventHandler.java @@ -45,8 +45,8 @@ import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.EventType; import org.openmetadata.schema.type.Post; import org.openmetadata.schema.type.Relationship; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.filter.FilterRegistry; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.CollectionDAO.EntityRelationshipRecord; @@ -65,7 +65,7 @@ public class ChangeEventHandler implements EventHandler { private FeedRepository feedDao; private ObjectMapper mapper; - public void init(CatalogApplicationConfig config, Jdbi jdbi) { + public void init(OpenMetadataApplicationConfig config, Jdbi jdbi) { this.dao = jdbi.onDemand(CollectionDAO.class); this.feedDao = new FeedRepository(dao); this.mapper = new ObjectMapper(); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/events/EventFilter.java b/openmetadata-service/src/main/java/org/openmetadata/service/events/EventFilter.java index f684bab37e9..ce5c09d88a3 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/events/EventFilter.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/events/EventFilter.java @@ -21,7 +21,7 @@ import javax.ws.rs.container.ContainerResponseFilter; import javax.ws.rs.ext.Provider; import lombok.extern.slf4j.Slf4j; import org.jdbi.v3.core.Jdbi; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.util.ParallelStreamUtil; @Slf4j @@ -32,13 +32,13 @@ public class EventFilter implements ContainerResponseFilter { private final ForkJoinPool forkJoinPool; private final List eventHandlers; - public EventFilter(CatalogApplicationConfig config, Jdbi jdbi) { + public EventFilter(OpenMetadataApplicationConfig config, Jdbi jdbi) { this.forkJoinPool = new ForkJoinPool(FORK_JOIN_POOL_PARALLELISM); this.eventHandlers = new ArrayList<>(); registerEventHandlers(config, jdbi); } - private void registerEventHandlers(CatalogApplicationConfig config, Jdbi jdbi) { + private void registerEventHandlers(OpenMetadataApplicationConfig config, Jdbi jdbi) { try { Set eventHandlerClassNames = new HashSet<>(config.getEventHandlerConfiguration().getEventHandlerClassNames()); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/events/EventHandler.java b/openmetadata-service/src/main/java/org/openmetadata/service/events/EventHandler.java index 442c3faa5ec..89f4fcf5f72 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/events/EventHandler.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/events/EventHandler.java @@ -16,10 +16,10 @@ package org.openmetadata.service.events; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.ContainerResponseContext; import org.jdbi.v3.core.Jdbi; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; public interface EventHandler { - void init(CatalogApplicationConfig config, Jdbi jdbi); + void init(OpenMetadataApplicationConfig config, Jdbi jdbi); Void process(ContainerRequestContext requestContext, ContainerResponseContext responseContext); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/fernet/Fernet.java b/openmetadata-service/src/main/java/org/openmetadata/service/fernet/Fernet.java index b46975da31c..6a30008e710 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/fernet/Fernet.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/fernet/Fernet.java @@ -30,7 +30,7 @@ import java.util.List; import java.util.stream.Collectors; import lombok.NonNull; import org.openmetadata.schema.api.fernet.FernetConfiguration; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; public class Fernet { private static Fernet instance; @@ -54,7 +54,7 @@ public class Fernet { return instance; } - public void setFernetKey(CatalogApplicationConfig config) { + public void setFernetKey(OpenMetadataApplicationConfig config) { FernetConfiguration fernetConfiguration = config.getFernetConfiguration(); if (fernetConfiguration != null && !FERNET_NO_ENCRYPTION.equals(fernetConfiguration.getFernetKey())) { setFernetKey(fernetConfiguration.getFernetKey()); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java index 88d7bb5794e..3aa7e1af273 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java @@ -74,8 +74,8 @@ import org.openmetadata.schema.type.FieldChange; import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.Relationship; import org.openmetadata.schema.type.TagLabel; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.TypeRegistry; import org.openmetadata.service.exception.CatalogExceptionMessage; import org.openmetadata.service.exception.EntityNotFoundException; @@ -239,7 +239,7 @@ public abstract class EntityRepository { * openmetadata-service/src/main/resources/json/data/{entityType} * *

This method needs to be explicitly called, typically from initialize method. See {@link - * org.openmetadata.service.resources.teams.RoleResource#initialize(CatalogApplicationConfig)} + * org.openmetadata.service.resources.teams.RoleResource#initialize(OpenMetadataApplicationConfig)} */ public void initSeedDataFromResources() throws IOException { List jsonDataFiles = diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/CollectionRegistry.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/CollectionRegistry.java index 4451aba1b00..e821ac78b75 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/CollectionRegistry.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/CollectionRegistry.java @@ -39,7 +39,7 @@ import org.jdbi.v3.core.Jdbi; import org.openmetadata.schema.Function; import org.openmetadata.schema.type.CollectionDescriptor; import org.openmetadata.schema.type.CollectionInfo; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.secrets.SecretsManager; import org.openmetadata.service.security.Authorizer; @@ -182,7 +182,7 @@ public final class CollectionRegistry { public void registerResources( Jdbi jdbi, Environment environment, - CatalogApplicationConfig config, + OpenMetadataApplicationConfig config, Authorizer authorizer, SecretsManager secretsManager) { // Build list of ResourceDescriptors @@ -254,7 +254,7 @@ public final class CollectionRegistry { private static Object createResource( CollectionDAO daoObject, String resourceClass, - CatalogApplicationConfig config, + OpenMetadataApplicationConfig config, Authorizer authorizer, SecretsManager secretsManager) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, @@ -272,7 +272,7 @@ public final class CollectionRegistry { .newInstance(daoObject, authorizer, secretsManager); } catch (NoSuchMethodException ex) { try { - resource = clz.getDeclaredConstructor(CatalogApplicationConfig.class).newInstance(config); + resource = clz.getDeclaredConstructor(OpenMetadataApplicationConfig.class).newInstance(config); } catch (NoSuchMethodException exc) { resource = Class.forName(resourceClass).getConstructor().newInstance(); } @@ -281,7 +281,7 @@ public final class CollectionRegistry { // Call initialize method, if it exists try { - Method initializeMethod = resource.getClass().getMethod("initialize", CatalogApplicationConfig.class); + Method initializeMethod = resource.getClass().getMethod("initialize", OpenMetadataApplicationConfig.class); initializeMethod.invoke(resource, config); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) { // Method does not exist and initialize is not called diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/config/ConfigResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/config/ConfigResource.java index 856f4b735f6..1fe473925de 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/config/ConfigResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/config/ConfigResource.java @@ -25,7 +25,7 @@ import javax.ws.rs.core.MediaType; import org.openmetadata.schema.api.security.AuthenticationConfiguration; import org.openmetadata.schema.api.security.AuthorizerConfiguration; import org.openmetadata.schema.api.slackChat.SlackChatConfiguration; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.airflow.AirflowConfigurationForAPI; import org.openmetadata.service.resources.Collection; import org.openmetadata.service.sandbox.SandboxConfiguration; @@ -37,11 +37,11 @@ import org.openmetadata.service.security.jwt.JWTTokenGenerator; @Produces(MediaType.APPLICATION_JSON) @Collection(name = "config") public class ConfigResource { - private final CatalogApplicationConfig catalogApplicationConfig; + private final OpenMetadataApplicationConfig openMetadataApplicationConfig; private final JWTTokenGenerator jwtTokenGenerator; - public ConfigResource(CatalogApplicationConfig catalogApplicationConfig) { - this.catalogApplicationConfig = catalogApplicationConfig; + public ConfigResource(OpenMetadataApplicationConfig openMetadataApplicationConfig) { + this.openMetadataApplicationConfig = openMetadataApplicationConfig; this.jwtTokenGenerator = JWTTokenGenerator.getInstance(); } @@ -62,8 +62,8 @@ public class ConfigResource { }) public AuthenticationConfiguration getAuthConfig() { AuthenticationConfiguration authenticationConfiguration = new AuthenticationConfiguration(); - if (catalogApplicationConfig.getAuthenticationConfiguration() != null) { - authenticationConfiguration = catalogApplicationConfig.getAuthenticationConfiguration(); + if (openMetadataApplicationConfig.getAuthenticationConfiguration() != null) { + authenticationConfiguration = openMetadataApplicationConfig.getAuthenticationConfiguration(); } return authenticationConfiguration; } @@ -85,8 +85,8 @@ public class ConfigResource { }) public AuthorizerConfiguration getAuthorizerConfig() { AuthorizerConfiguration authorizerConfiguration = new AuthorizerConfiguration(); - if (catalogApplicationConfig.getAuthorizerConfiguration() != null) { - authorizerConfiguration = catalogApplicationConfig.getAuthorizerConfiguration(); + if (openMetadataApplicationConfig.getAuthorizerConfiguration() != null) { + authorizerConfiguration = openMetadataApplicationConfig.getAuthorizerConfiguration(); } return authorizerConfiguration; } @@ -106,7 +106,7 @@ public class ConfigResource { }) public SandboxConfiguration getSandboxMode() { SandboxConfiguration sandboxConfiguration = new SandboxConfiguration(); - if (catalogApplicationConfig.isSandboxModeEnabled()) { + if (openMetadataApplicationConfig.isSandboxModeEnabled()) { sandboxConfiguration.setSandboxModeEnabled(true); } return sandboxConfiguration; @@ -129,8 +129,8 @@ public class ConfigResource { }) public SlackChatConfiguration getSlackChatConfiguration() { SlackChatConfiguration slackChatConfiguration = new SlackChatConfiguration(); - if (catalogApplicationConfig.getSlackChatConfiguration() != null) { - slackChatConfiguration = catalogApplicationConfig.getSlackChatConfiguration(); + if (openMetadataApplicationConfig.getSlackChatConfiguration() != null) { + slackChatConfiguration = openMetadataApplicationConfig.getSlackChatConfiguration(); } return slackChatConfiguration; } @@ -152,8 +152,9 @@ public class ConfigResource { }) public AirflowConfigurationForAPI getAirflowConfig() { AirflowConfigurationForAPI airflowConfigurationForAPI = new AirflowConfigurationForAPI(); - if (catalogApplicationConfig.getAirflowConfiguration() != null) { - airflowConfigurationForAPI.setApiEndpoint(catalogApplicationConfig.getAirflowConfiguration().getApiEndpoint()); + if (openMetadataApplicationConfig.getAirflowConfiguration() != null) { + airflowConfigurationForAPI.setApiEndpoint( + openMetadataApplicationConfig.getAirflowConfiguration().getApiEndpoint()); } return airflowConfigurationForAPI; } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestDefinitionResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestDefinitionResource.java index e3138c8b2c4..1a9e24dbe8b 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestDefinitionResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestDefinitionResource.java @@ -40,8 +40,8 @@ import org.openmetadata.schema.tests.TestDefinition; import org.openmetadata.schema.type.EntityHistory; import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.TestDefinitionEntityType; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.ListFilter; import org.openmetadata.service.jdbi3.TestDefinitionRepository; @@ -79,7 +79,7 @@ public class TestDefinitionResource extends EntityResource testDefinitionFiles = EntityUtil.getJsonDataResources(".*json/data/tests/.*\\.json$"); testDefinitionFiles.forEach( diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/events/WebhookResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/events/WebhookResource.java index 919d0d178ce..6064d511770 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/events/WebhookResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/events/WebhookResource.java @@ -51,7 +51,7 @@ import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.Webhook; import org.openmetadata.schema.type.Webhook.Status; import org.openmetadata.schema.type.WebhookType; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.CollectionDAO.WebhookDAO; import org.openmetadata.service.jdbi3.ListFilter; @@ -92,7 +92,7 @@ public class WebhookResource extends EntityResource } @SuppressWarnings("unused") // Method used for reflection - public void initialize(CatalogApplicationConfig config) throws IOException { + public void initialize(OpenMetadataApplicationConfig config) throws IOException { try { List listAllWebhooks = webhookDAO.listAllWebhooks(webhookDAO.getTableName()); List webhookList = JsonUtils.readObjects(listAllWebhooks, Webhook.class); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java index da8d89e00b3..3621a0cf229 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java @@ -56,9 +56,9 @@ import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.Function; import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.ResourceDescriptor; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; import org.openmetadata.service.FunctionList; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.ResourceRegistry; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.ListFilter; @@ -96,7 +96,7 @@ public class PolicyResource extends EntityResource { } @SuppressWarnings("unused") // Method is used for reflection - public void initialize(CatalogApplicationConfig config) throws IOException { + public void initialize(OpenMetadataApplicationConfig config) throws IOException { // Load any existing rules from database, before loading seed data. dao.initSeedDataFromResources(); ResourceRegistry.add(listOrEmpty(PolicyResource.getResourceDescriptors())); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java index dad69b9fab6..03c39543bb8 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResource.java @@ -60,8 +60,8 @@ import org.openmetadata.schema.services.connections.metadata.OpenMetadataServerC import org.openmetadata.schema.type.EntityHistory; import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.MetadataOperation; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.airflow.AirflowRESTClient; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.IngestionPipelineRepository; @@ -85,7 +85,7 @@ import org.openmetadata.service.util.ResultList; public class IngestionPipelineResource extends EntityResource { public static final String COLLECTION_PATH = "v1/services/ingestionPipelines/"; private PipelineServiceClient pipelineServiceClient; - private CatalogApplicationConfig catalogApplicationConfig; + private OpenMetadataApplicationConfig openMetadataApplicationConfig; private final SecretsManager secretsManager; @Getter private final IngestionPipelineRepository ingestionPipelineRepository; @@ -103,9 +103,9 @@ public class IngestionPipelineResource extends EntityResource response = pipelineServiceClient.testConnection(testServiceConnection); return Response.status(200, response.body()).build(); } @@ -586,8 +586,8 @@ public class IngestionPipelineResource extends EntityResource bootStrappedFilters; @SuppressWarnings("unused") // Method used for reflection - public void initialize(CatalogApplicationConfig config) throws IOException { + public void initialize(OpenMetadataApplicationConfig config) throws IOException { initSettings(); } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/tags/TagResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/tags/TagResource.java index c47db66733b..9c6cd359484 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/tags/TagResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/tags/TagResource.java @@ -49,8 +49,8 @@ import org.openmetadata.schema.api.tags.CreateTagCategory; import org.openmetadata.schema.entity.tags.Tag; import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.TagCategory; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.ListFilter; import org.openmetadata.service.jdbi3.TagCategoryRepository; @@ -93,7 +93,7 @@ public class TagResource { } @SuppressWarnings("unused") // Method used for reflection - public void initialize(CatalogApplicationConfig config) throws IOException { + public void initialize(OpenMetadataApplicationConfig config) throws IOException { // Find tag definitions and load tag categories from the json file, if necessary List tagFiles = EntityUtil.getJsonDataResources(".*json/data/tags/.*\\.json$"); tagFiles.forEach( diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/teams/RoleResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/teams/RoleResource.java index 66ab14e7d22..5e865a0ac5a 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/teams/RoleResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/teams/RoleResource.java @@ -54,8 +54,8 @@ import org.openmetadata.schema.entity.teams.Role; import org.openmetadata.schema.type.EntityHistory; import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.Include; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.ListFilter; import org.openmetadata.service.jdbi3.RoleRepository; @@ -91,7 +91,7 @@ public class RoleResource extends EntityResource { } @SuppressWarnings("unused") // Method used for reflection - public void initialize(CatalogApplicationConfig config) throws IOException { + public void initialize(OpenMetadataApplicationConfig config) throws IOException { List jsonFiles = EntityUtil.getJsonDataResources(String.format(".*json/data/%s/.*\\.json$", Entity.ROLE)); jsonFiles.forEach( jsonFile -> { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/teams/TeamResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/teams/TeamResource.java index aa49f45a8ec..5b4142fdb3a 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/teams/TeamResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/teams/TeamResource.java @@ -54,8 +54,8 @@ import org.openmetadata.schema.api.teams.CreateTeam.TeamType; import org.openmetadata.schema.entity.teams.Team; import org.openmetadata.schema.type.EntityHistory; import org.openmetadata.schema.type.Include; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.ListFilter; import org.openmetadata.service.jdbi3.TeamRepository; @@ -91,7 +91,7 @@ public class TeamResource extends EntityResource { } @SuppressWarnings("unused") // Method used for reflection - public void initialize(CatalogApplicationConfig config) throws IOException { + public void initialize(OpenMetadataApplicationConfig config) throws IOException { dao.initOrganization(); } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/types/TypeResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/types/TypeResource.java index 0cc0691cb98..33d90dc48fa 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/types/TypeResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/types/TypeResource.java @@ -55,8 +55,8 @@ import org.openmetadata.schema.entity.type.Category; import org.openmetadata.schema.entity.type.CustomProperty; import org.openmetadata.schema.type.EntityHistory; import org.openmetadata.schema.type.Include; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.ListFilter; import org.openmetadata.service.jdbi3.TypeRepository; @@ -89,7 +89,7 @@ public class TypeResource extends EntityResource { } @SuppressWarnings("unused") // Method used for reflection - public void initialize(CatalogApplicationConfig config) throws IOException { + public void initialize(OpenMetadataApplicationConfig config) throws IOException { // Load types defined in OpenMetadata schemas long now = System.currentTimeMillis(); List types = JsonUtils.getTypes(); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/version/VersionResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/version/VersionResource.java index cbd342b4c05..7f837a92a1a 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/version/VersionResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/version/VersionResource.java @@ -23,7 +23,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import lombok.extern.slf4j.Slf4j; import org.openmetadata.schema.api.OpenMetadataServerVersion; -import org.openmetadata.service.CatalogApplication; +import org.openmetadata.service.OpenMetadataApplication; import org.openmetadata.service.resources.Collection; @Slf4j @@ -37,7 +37,7 @@ public class VersionResource { static { OPEN_METADATA_SERVER_VERSION = new OpenMetadataServerVersion(); try { - InputStream fileInput = CatalogApplication.class.getResourceAsStream("/catalog/VERSION"); + InputStream fileInput = OpenMetadataApplication.class.getResourceAsStream("/catalog/VERSION"); Properties props = new Properties(); props.load(fileInput); OPEN_METADATA_SERVER_VERSION.setVersion(props.getProperty("version", "unknown")); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/util/PipelineServiceClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/util/PipelineServiceClient.java index c3e26aa6ec0..888b9fc3204 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/util/PipelineServiceClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/util/PipelineServiceClient.java @@ -16,7 +16,7 @@ import java.util.regex.Pattern; import javax.ws.rs.core.Response; import org.openmetadata.schema.api.services.ingestionPipelines.TestServiceConnection; import org.openmetadata.schema.entity.services.ingestionPipelines.IngestionPipeline; -import org.openmetadata.service.CatalogApplication; +import org.openmetadata.service.OpenMetadataApplication; import org.openmetadata.service.exception.PipelineServiceClientException; import org.openmetadata.service.exception.PipelineServiceVersionException; @@ -92,7 +92,7 @@ public abstract class PipelineServiceClient { } public static String getServerVersion() throws IOException { - InputStream fileInput = CatalogApplication.class.getResourceAsStream("/catalog/VERSION"); + InputStream fileInput = OpenMetadataApplication.class.getResourceAsStream("/catalog/VERSION"); Properties props = new Properties(); props.load(fileInput); return props.getProperty("version", "unknown"); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/util/TablesInitializer.java b/openmetadata-service/src/main/java/org/openmetadata/service/util/TablesInitializer.java index 9a28c5c8280..aeb7a485a95 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/util/TablesInitializer.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/util/TablesInitializer.java @@ -49,7 +49,7 @@ import org.openmetadata.schema.entity.teams.User; import org.openmetadata.schema.teams.authn.GenerateTokenRequest; import org.openmetadata.schema.teams.authn.JWTAuthMechanism; import org.openmetadata.schema.teams.authn.JWTTokenExpiry; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.elasticsearch.ElasticSearchIndexDefinition; import org.openmetadata.service.fernet.Fernet; import org.openmetadata.service.jdbi3.CollectionDAO; @@ -143,9 +143,9 @@ public final class TablesInitializer { String confFilePath = commandLine.getOptionValue(OPTION_CONFIG_FILE_PATH); ObjectMapper objectMapper = Jackson.newObjectMapper(); Validator validator = Validators.newValidator(); - YamlConfigurationFactory factory = - new YamlConfigurationFactory<>(CatalogApplicationConfig.class, validator, objectMapper, "dw"); - CatalogApplicationConfig config = + YamlConfigurationFactory factory = + new YamlConfigurationFactory<>(OpenMetadataApplicationConfig.class, validator, objectMapper, "dw"); + OpenMetadataApplicationConfig config = factory.build( new SubstitutingSourceProvider( new FileConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)), @@ -212,7 +212,7 @@ public final class TablesInitializer { } private static void execute( - CatalogApplicationConfig config, + OpenMetadataApplicationConfig config, Flyway flyway, RestHighLevelClient client, SchemaMigrationOption schemaMigrationOption) @@ -301,7 +301,7 @@ public final class TablesInitializer { System.out.println(message); } - private static void createIngestionBot(CatalogApplicationConfig config) { + private static void createIngestionBot(OpenMetadataApplicationConfig config) { final Jdbi jdbi = Jdbi.create( config.getDataSourceFactory().getUrl(), @@ -346,7 +346,7 @@ public final class TablesInitializer { } } - private static void updateIngestionBot(CatalogApplicationConfig config) { + private static void updateIngestionBot(OpenMetadataApplicationConfig config) { final Jdbi jdbi = Jdbi.create( config.getDataSourceFactory().getUrl(), diff --git a/openmetadata-spec/src/main/resources/elasticsearch/dashboard_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/dashboard_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/dashboard_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/dashboard_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/elasticsearch/glossary_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/glossary_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/glossary_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/glossary_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/elasticsearch/mlmodel_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/mlmodel_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/mlmodel_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/mlmodel_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/elasticsearch/pipeline_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/pipeline_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/pipeline_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/pipeline_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/elasticsearch/table_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/table_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/table_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/table_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/elasticsearch/tag_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/tag_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/tag_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/tag_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/elasticsearch/team_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/team_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/team_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/team_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/elasticsearch/topic_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/topic_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/topic_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/topic_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/elasticsearch/user_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/user_index_mapping.json similarity index 100% rename from openmetadata-spec/src/main/resources/elasticsearch/user_index_mapping.json rename to openmetadata-service/src/main/resources/elasticsearch/user_index_mapping.json diff --git a/openmetadata-spec/src/main/resources/json/data/ResourceDescriptors.json b/openmetadata-service/src/main/resources/json/data/ResourceDescriptors.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/ResourceDescriptors.json rename to openmetadata-service/src/main/resources/json/data/ResourceDescriptors.json diff --git a/openmetadata-spec/src/main/resources/json/data/policy/DataConsumerPolicy.json b/openmetadata-service/src/main/resources/json/data/policy/DataConsumerPolicy.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/policy/DataConsumerPolicy.json rename to openmetadata-service/src/main/resources/json/data/policy/DataConsumerPolicy.json diff --git a/openmetadata-spec/src/main/resources/json/data/policy/DataStewardPolicy.json b/openmetadata-service/src/main/resources/json/data/policy/DataStewardPolicy.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/policy/DataStewardPolicy.json rename to openmetadata-service/src/main/resources/json/data/policy/DataStewardPolicy.json diff --git a/openmetadata-spec/src/main/resources/json/data/policy/OrganizationPolicy.json b/openmetadata-service/src/main/resources/json/data/policy/OrganizationPolicy.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/policy/OrganizationPolicy.json rename to openmetadata-service/src/main/resources/json/data/policy/OrganizationPolicy.json diff --git a/openmetadata-spec/src/main/resources/json/data/policy/TeamOnlyPolicy.json b/openmetadata-service/src/main/resources/json/data/policy/TeamOnlyPolicy.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/policy/TeamOnlyPolicy.json rename to openmetadata-service/src/main/resources/json/data/policy/TeamOnlyPolicy.json diff --git a/openmetadata-spec/src/main/resources/json/data/role/DataConsumer.json b/openmetadata-service/src/main/resources/json/data/role/DataConsumer.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/role/DataConsumer.json rename to openmetadata-service/src/main/resources/json/data/role/DataConsumer.json diff --git a/openmetadata-spec/src/main/resources/json/data/role/DataSteward.json b/openmetadata-service/src/main/resources/json/data/role/DataSteward.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/role/DataSteward.json rename to openmetadata-service/src/main/resources/json/data/role/DataSteward.json diff --git a/openmetadata-spec/src/main/resources/json/data/settings/settingsData.json b/openmetadata-service/src/main/resources/json/data/settings/settingsData.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/settings/settingsData.json rename to openmetadata-service/src/main/resources/json/data/settings/settingsData.json diff --git a/openmetadata-spec/src/main/resources/json/data/tags/personalDataTags.json b/openmetadata-service/src/main/resources/json/data/tags/personalDataTags.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tags/personalDataTags.json rename to openmetadata-service/src/main/resources/json/data/tags/personalDataTags.json diff --git a/openmetadata-spec/src/main/resources/json/data/tags/piiTags.json b/openmetadata-service/src/main/resources/json/data/tags/piiTags.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tags/piiTags.json rename to openmetadata-service/src/main/resources/json/data/tags/piiTags.json diff --git a/openmetadata-spec/src/main/resources/json/data/tags/tierTags.json b/openmetadata-service/src/main/resources/json/data/tags/tierTags.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tags/tierTags.json rename to openmetadata-service/src/main/resources/json/data/tags/tierTags.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValueMaxToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/columnValueMaxToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValueMaxToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValueMaxToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValueMeanToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/columnValueMeanToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValueMeanToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValueMeanToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValueMedianToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/columnValueMedianToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValueMedianToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValueMedianToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValueMinToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/columnValueMinToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValueMinToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValueMinToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValueStdDevToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/columnValueStdDevToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValueStdDevToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValueStdDevToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesLengthsToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesLengthsToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesLengthsToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesLengthsToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesMissingCountToBeEqual.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesMissingCountToBeEqual.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesMissingCountToBeEqual.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesMissingCountToBeEqual.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesSumToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesSumToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesSumToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesSumToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeInSet.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeInSet.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeInSet.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeInSet.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeNotInSet.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeNotInSet.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeNotInSet.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeNotInSet.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeNotNull.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeNotNull.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeNotNull.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeNotNull.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeUnique.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeUnique.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesToBeUnique.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesToBeUnique.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesToMatchRegex.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesToMatchRegex.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesToMatchRegex.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesToMatchRegex.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/columnValuesToNotMatchRegex.json b/openmetadata-service/src/main/resources/json/data/tests/columnValuesToNotMatchRegex.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/columnValuesToNotMatchRegex.json rename to openmetadata-service/src/main/resources/json/data/tests/columnValuesToNotMatchRegex.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/tableColumnCountToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/tableColumnCountToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/tableColumnCountToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/tableColumnCountToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/tableColumnCountToEqual.json b/openmetadata-service/src/main/resources/json/data/tests/tableColumnCountToEqual.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/tableColumnCountToEqual.json rename to openmetadata-service/src/main/resources/json/data/tests/tableColumnCountToEqual.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/tableColumnNameToExist.json b/openmetadata-service/src/main/resources/json/data/tests/tableColumnNameToExist.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/tableColumnNameToExist.json rename to openmetadata-service/src/main/resources/json/data/tests/tableColumnNameToExist.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/tableColumnToMatchSet.json b/openmetadata-service/src/main/resources/json/data/tests/tableColumnToMatchSet.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/tableColumnToMatchSet.json rename to openmetadata-service/src/main/resources/json/data/tests/tableColumnToMatchSet.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/tableCustomSQLQuery.json b/openmetadata-service/src/main/resources/json/data/tests/tableCustomSQLQuery.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/tableCustomSQLQuery.json rename to openmetadata-service/src/main/resources/json/data/tests/tableCustomSQLQuery.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/tableRowCountToBeBetween.json b/openmetadata-service/src/main/resources/json/data/tests/tableRowCountToBeBetween.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/tableRowCountToBeBetween.json rename to openmetadata-service/src/main/resources/json/data/tests/tableRowCountToBeBetween.json diff --git a/openmetadata-spec/src/main/resources/json/data/tests/tableRowCountToEqual.json b/openmetadata-service/src/main/resources/json/data/tests/tableRowCountToEqual.json similarity index 100% rename from openmetadata-spec/src/main/resources/json/data/tests/tableRowCountToEqual.json rename to openmetadata-service/src/main/resources/json/data/tests/tableRowCountToEqual.json diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/CatalogApplicationTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/OpenMetadataApplicationTest.java similarity index 96% rename from openmetadata-service/src/test/java/org/openmetadata/service/CatalogApplicationTest.java rename to openmetadata-service/src/test/java/org/openmetadata/service/OpenMetadataApplicationTest.java index d79a880ae9b..5681df12ec1 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/CatalogApplicationTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/OpenMetadataApplicationTest.java @@ -35,10 +35,10 @@ import org.openmetadata.service.security.policyevaluator.SubjectCache; import org.testcontainers.containers.JdbcDatabaseContainer; @Slf4j -public abstract class CatalogApplicationTest { +public abstract class OpenMetadataApplicationTest { protected static final String CONFIG_PATH = ResourceHelpers.resourceFilePath("openmetadata-secure-test.yaml"); private static JdbcDatabaseContainer SQL_CONTAINER; - public static DropwizardAppExtension APP; + public static DropwizardAppExtension APP; protected static final WebhookCallbackResource webhookCallbackResource = new WebhookCallbackResource(); public static final String FERNET_KEY_1 = "ihZpp5gmmDvVsgoOG6OVivKWwC9vd5JQ"; @@ -76,7 +76,7 @@ public abstract class CatalogApplicationTest { APP = new DropwizardAppExtension<>( - CatalogApplication.class, + OpenMetadataApplication.class, CONFIG_PATH, // Database overrides ConfigOverride.config("database.driverClass", SQL_CONTAINER.getDriverClassName()), diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/fixtures/ConfigurationFixtures.java b/openmetadata-service/src/test/java/org/openmetadata/service/fixtures/ConfigurationFixtures.java index 1c3dcc19776..0b2d0791538 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/fixtures/ConfigurationFixtures.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/fixtures/ConfigurationFixtures.java @@ -13,23 +13,23 @@ import org.openmetadata.schema.security.client.OktaSSOClientConfig; import org.openmetadata.schema.security.client.OpenMetadataJWTClientConfig; import org.openmetadata.schema.security.ssl.ValidateSSLClientConfig; import org.openmetadata.schema.services.connections.metadata.OpenMetadataServerConnection; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.migration.MigrationConfiguration; public class ConfigurationFixtures { - public static CatalogApplicationConfig buildCatalogApplicationConfig( + public static OpenMetadataApplicationConfig buildOpenMetadataApplicationConfig( OpenMetadataServerConnection.AuthProvider authProvider) { - CatalogApplicationConfig catalogApplicationConfig = new CatalogApplicationConfig(); + OpenMetadataApplicationConfig openMetadataApplicationConfig = new OpenMetadataApplicationConfig(); DataSourceFactory dataSourceFactory = new DataSourceFactory(); dataSourceFactory.setDriverClass("driverClass"); dataSourceFactory.setUrl("http://localhost"); MigrationConfiguration migrationConfiguration = new MigrationConfiguration(); migrationConfiguration.setPath("/fake/path"); - catalogApplicationConfig.setDataSourceFactory(dataSourceFactory); - catalogApplicationConfig.setMigrationConfiguration(migrationConfiguration); - catalogApplicationConfig.setAirflowConfiguration(buildAirflowConfig(authProvider)); - return catalogApplicationConfig; + openMetadataApplicationConfig.setDataSourceFactory(dataSourceFactory); + openMetadataApplicationConfig.setMigrationConfiguration(migrationConfiguration); + openMetadataApplicationConfig.setAirflowConfiguration(buildAirflowConfig(authProvider)); + return openMetadataApplicationConfig; } public static AirflowConfiguration buildAirflowConfig(OpenMetadataServerConnection.AuthProvider authProvider) { diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/ChangeEventParserResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/ChangeEventParserResourceTest.java index 5a8f0c3beeb..36e369c2d81 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/ChangeEventParserResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/ChangeEventParserResourceTest.java @@ -40,7 +40,7 @@ import org.openmetadata.schema.type.FieldChange; import org.openmetadata.schema.type.TagLabel; import org.openmetadata.schema.type.TagLabel.LabelType; import org.openmetadata.schema.type.TagLabel.State; -import org.openmetadata.service.CatalogApplicationTest; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.databases.TableResourceTest; import org.openmetadata.service.resources.feeds.MessageParser.EntityLink; import org.openmetadata.service.util.ChangeEventParser; @@ -49,7 +49,7 @@ import org.openmetadata.service.util.JsonUtils; @Slf4j @TestInstance(Lifecycle.PER_CLASS) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class ChangeEventParserResourceTest extends CatalogApplicationTest { +class ChangeEventParserResourceTest extends OpenMetadataApplicationTest { Table TABLE; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java index 6b8a777bdcf..6c776036a42 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java @@ -123,8 +123,8 @@ import org.openmetadata.schema.type.FieldChange; import org.openmetadata.schema.type.Include; import org.openmetadata.schema.type.MetadataOperation; import org.openmetadata.schema.type.TagLabel; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.exception.CatalogExceptionMessage; import org.openmetadata.service.resources.databases.TableResourceTest; import org.openmetadata.service.resources.dqtests.TestCaseResourceTest; @@ -154,7 +154,7 @@ import org.openmetadata.service.util.TestUtils; @Slf4j @TestInstance(TestInstance.Lifecycle.PER_CLASS) public abstract class EntityResourceTest - extends CatalogApplicationTest { + extends OpenMetadataApplicationTest { private static final Map> ENTITY_RESOURCE_TEST_MAP = new HashMap<>(); private final String entityType; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/config/ConfigResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/config/ConfigResourceTest.java index a8535501106..758f08ca53d 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/config/ConfigResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/config/ConfigResourceTest.java @@ -32,25 +32,25 @@ import org.junit.jupiter.api.TestInstance; import org.openmetadata.schema.api.security.AuthenticationConfiguration; import org.openmetadata.schema.api.security.AuthorizerConfiguration; import org.openmetadata.schema.api.slackChat.SlackChatConfiguration; -import org.openmetadata.service.CatalogApplicationConfig; -import org.openmetadata.service.CatalogApplicationTest; +import org.openmetadata.service.OpenMetadataApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.airflow.AirflowConfigurationForAPI; import org.openmetadata.service.security.jwt.JWKSKey; import org.openmetadata.service.security.jwt.JWKSResponse; import org.openmetadata.service.util.TestUtils; @TestInstance(TestInstance.Lifecycle.PER_CLASS) -class ConfigResourceTest extends CatalogApplicationTest { +class ConfigResourceTest extends OpenMetadataApplicationTest { - static CatalogApplicationConfig config; + static OpenMetadataApplicationConfig config; @BeforeAll static void setup() throws IOException, ConfigurationException { // Get config object from test yaml file ObjectMapper objectMapper = Jackson.newObjectMapper(); Validator validator = Validators.newValidator(); - YamlConfigurationFactory factory = - new YamlConfigurationFactory<>(CatalogApplicationConfig.class, validator, objectMapper, "dw"); + YamlConfigurationFactory factory = + new YamlConfigurationFactory<>(OpenMetadataApplicationConfig.class, validator, objectMapper, "dw"); config = factory.build(new FileConfigurationSourceProvider(), CONFIG_PATH); } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/databases/TableResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/databases/TableResourceTest.java index 516d4cbb23e..75876814d69 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/databases/TableResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/databases/TableResourceTest.java @@ -119,8 +119,8 @@ import org.openmetadata.schema.type.TableProfilerConfig; import org.openmetadata.schema.type.TableType; import org.openmetadata.schema.type.TagLabel; import org.openmetadata.schema.type.TagLabel.LabelType; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.EntityResourceTest; import org.openmetadata.service.resources.databases.TableResource.TableList; import org.openmetadata.service.resources.glossary.GlossaryResourceTest; @@ -1733,7 +1733,7 @@ public class TableResourceTest extends EntityResourceTest { } private void deleteAndCheckLocation(Table table, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource(String.format("tables/%s/location", table.getId())); + WebTarget target = OpenMetadataApplicationTest.getResource(String.format("tables/%s/location", table.getId())); TestUtils.delete(target, authHeaders); checkLocationDeleted(table.getId(), authHeaders); } @@ -1745,7 +1745,7 @@ public class TableResourceTest extends EntityResourceTest { public void addAndCheckLocation(Table table, UUID locationId, Status status, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource(String.format("tables/%s/location", table.getId())); + WebTarget target = OpenMetadataApplicationTest.getResource(String.format("tables/%s/location", table.getId())); TestUtils.put(target, locationId, status, authHeaders); // GET .../tables/{tableId} returns newly added location @@ -1894,70 +1894,70 @@ public class TableResourceTest extends EntityResourceTest { public static Table putJoins(UUID tableId, TableJoins joins, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + tableId + "/joins"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/joins"); return TestUtils.put(target, joins, Table.class, OK, authHeaders); } public static Table putSampleData(UUID tableId, TableData data, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + tableId + "/sampleData"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/sampleData"); return TestUtils.put(target, data, Table.class, OK, authHeaders); } public static Table putTableProfilerConfig(UUID tableId, TableProfilerConfig data, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + tableId + "/tableProfilerConfig"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableProfilerConfig"); return TestUtils.put(target, data, Table.class, OK, authHeaders); } public static Table deleteTableProfilerConfig(UUID tableId, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + tableId + "/tableProfilerConfig"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableProfilerConfig"); return TestUtils.delete(target, Table.class, authHeaders); } public static Table putTableProfileData(UUID tableId, CreateTableProfile data, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + tableId + "/tableProfile"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableProfile"); return TestUtils.put(target, data, Table.class, OK, authHeaders); } public static void deleteTableProfile(String fqn, String entityType, Long timestamp, Map authHeaders) throws HttpResponseException { WebTarget target = - CatalogApplicationTest.getResource("tables/" + fqn + "/" + entityType + "/" + timestamp + "/profile"); + OpenMetadataApplicationTest.getResource("tables/" + fqn + "/" + entityType + "/" + timestamp + "/profile"); TestUtils.delete(target, authHeaders); } public static ResultList getTableProfiles(String fqn, Integer limit, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + fqn + "/tableProfile"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + fqn + "/tableProfile"); target = limit != null ? target.queryParam("limit", limit) : target; return TestUtils.get(target, TableResource.TableProfileList.class, authHeaders); } public static ResultList getColumnProfiles(String fqn, Integer limit, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + fqn + "/columnProfile"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + fqn + "/columnProfile"); target = limit != null ? target.queryParam("limit", limit) : target; return TestUtils.get(target, TableResource.ColumnProfileList.class, authHeaders); } public static Table putTableQueriesData(UUID tableId, SQLQuery data, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + tableId + "/tableQuery"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableQuery"); return TestUtils.put(target, data, Table.class, OK, authHeaders); } public static Table putTableDataModel(UUID tableId, DataModel dataModel, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + tableId + "/dataModel"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/dataModel"); return TestUtils.put(target, dataModel, Table.class, OK, authHeaders); } public static Table putCustomMetric(UUID tableId, CreateCustomMetric data, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("tables/" + tableId + "/customMetric"); + WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/customMetric"); return TestUtils.put(target, data, Table.class, OK, authHeaders); } @@ -1965,7 +1965,7 @@ public class TableResourceTest extends EntityResourceTest { UUID tableId, String columnName, String metricName, Map authHeaders) throws HttpResponseException { WebTarget target = - CatalogApplicationTest.getResource("tables/" + tableId + "/customMetric/" + columnName + "/" + metricName); + OpenMetadataApplicationTest.getResource("tables/" + tableId + "/customMetric/" + columnName + "/" + metricName); return TestUtils.delete(target, Table.class, authHeaders); } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/dqtests/TestCaseResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/dqtests/TestCaseResourceTest.java index a51eff54317..e23c5f9e961 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/dqtests/TestCaseResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/dqtests/TestCaseResourceTest.java @@ -44,8 +44,8 @@ import org.openmetadata.schema.type.ChangeDescription; import org.openmetadata.schema.type.Column; import org.openmetadata.schema.type.ColumnDataType; import org.openmetadata.schema.type.MetadataOperation; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.EntityResourceTest; import org.openmetadata.service.resources.databases.TableResourceTest; import org.openmetadata.service.util.JsonUtils; @@ -351,7 +351,7 @@ public class TestCaseResourceTest extends EntityResourceTest authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("testCase/" + fqn + "/testCaseResult"); + WebTarget target = OpenMetadataApplicationTest.getResource("testCase/" + fqn + "/testCaseResult"); TestUtils.put(target, data, CREATED, authHeaders); } @@ -409,13 +409,13 @@ public class TestCaseResourceTest extends EntityResourceTest authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("testCase/" + fqn + "/testCaseResult/" + timestamp); + WebTarget target = OpenMetadataApplicationTest.getResource("testCase/" + fqn + "/testCaseResult/" + timestamp); TestUtils.delete(target, authHeaders); } public static ResultList getTestCaseResults( String fqn, Integer limit, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("testCase/" + fqn + "/testCaseResult"); + WebTarget target = OpenMetadataApplicationTest.getResource("testCase/" + fqn + "/testCaseResult"); target = limit != null ? target.queryParam("limit", limit) : target; return TestUtils.get(target, TestCaseResource.TestCaseResultList.class, authHeaders); } @@ -423,7 +423,7 @@ public class TestCaseResourceTest extends EntityResourceTest getTestCases( Integer limit, String fields, String link, Boolean includeAll, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("testCase"); + WebTarget target = OpenMetadataApplicationTest.getResource("testCase"); target = limit != null ? target.queryParam("limit", limit) : target; target = target.queryParam("fields", fields); if (link != null) { @@ -438,7 +438,7 @@ public class TestCaseResourceTest extends EntityResourceTest getTestCases( Integer limit, String fields, TestSuite testSuite, Boolean includeAll, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("testCase"); + WebTarget target = OpenMetadataApplicationTest.getResource("testCase"); target = limit != null ? target.queryParam("limit", limit) : target; target = target.queryParam("fields", fields); target = target.queryParam("testSuiteId", testSuite.getId()); diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/dqtests/TestSuiteResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/dqtests/TestSuiteResourceTest.java index 2f9561c5f6a..83725695354 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/dqtests/TestSuiteResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/dqtests/TestSuiteResourceTest.java @@ -22,8 +22,8 @@ import org.openmetadata.schema.api.tests.CreateTestSuite; import org.openmetadata.schema.tests.TestCase; import org.openmetadata.schema.tests.TestSuite; import org.openmetadata.schema.type.EntityReference; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.EntityResourceTest; import org.openmetadata.service.util.ResultList; import org.openmetadata.service.util.TestUtils; @@ -107,7 +107,7 @@ public class TestSuiteResourceTest extends EntityResourceTest getTestSuites(Integer limit, String fields, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("testSuite"); + WebTarget target = OpenMetadataApplicationTest.getResource("testSuite"); target = limit != null ? target.queryParam("limit", limit) : target; target = target.queryParam("fields", fields); return TestUtils.get(target, TestSuiteResource.TestSuiteList.class, authHeaders); diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/feeds/FeedResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/feeds/FeedResourceTest.java index 9501e3c289c..c88f0343795 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/feeds/FeedResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/feeds/FeedResourceTest.java @@ -99,8 +99,8 @@ import org.openmetadata.schema.type.TaskDetails; import org.openmetadata.schema.type.TaskStatus; import org.openmetadata.schema.type.TaskType; import org.openmetadata.schema.type.ThreadType; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.jdbi3.FeedRepository.FilterType; import org.openmetadata.service.resources.databases.TableResourceTest; import org.openmetadata.service.resources.feeds.FeedResource.PostList; @@ -114,7 +114,7 @@ import org.openmetadata.service.util.TestUtils; @Slf4j @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class FeedResourceTest extends CatalogApplicationTest { +public class FeedResourceTest extends OpenMetadataApplicationTest { public static Table TABLE; public static Table TABLE2; public static String TABLE_LINK; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/lineage/LineageResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/lineage/LineageResourceTest.java index 0a17834a260..2aa1d4af038 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/lineage/LineageResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/lineage/LineageResourceTest.java @@ -53,8 +53,8 @@ import org.openmetadata.schema.type.EntityLineage; import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.LineageDetails; import org.openmetadata.schema.type.MetadataOperation; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.databases.TableResourceTest; import org.openmetadata.service.resources.teams.RoleResource; import org.openmetadata.service.resources.teams.RoleResourceTest; @@ -63,7 +63,7 @@ import org.openmetadata.service.util.TestUtils; @Slf4j @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class LineageResourceTest extends CatalogApplicationTest { +public class LineageResourceTest extends OpenMetadataApplicationTest { public static final List TABLES = new ArrayList<>(); public static final int TABLE_COUNT = 10; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/locations/LocationResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/locations/LocationResourceTest.java index 9162659e8a5..5440675f98a 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/locations/LocationResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/locations/LocationResourceTest.java @@ -40,8 +40,8 @@ import org.junit.jupiter.api.TestInfo; import org.openmetadata.schema.api.data.CreateLocation; import org.openmetadata.schema.entity.data.Location; import org.openmetadata.schema.type.EntityReference; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.EntityResourceTest; import org.openmetadata.service.resources.locations.LocationResource.LocationList; import org.openmetadata.service.util.FullyQualifiedName; @@ -106,7 +106,8 @@ public class LocationResourceTest extends EntityResourceTest getAssociatedEntity(Location location) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource(String.format("locations/association/%s", location.getId())); + WebTarget target = + OpenMetadataApplicationTest.getResource(String.format("locations/association/%s", location.getId())); return (List) TestUtils.get(target, List.class, ADMIN_AUTH_HEADERS); } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/permissions/PermissionsResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/permissions/PermissionsResourceTest.java index f62d67ff70f..c1040bb9a62 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/permissions/PermissionsResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/permissions/PermissionsResourceTest.java @@ -57,8 +57,8 @@ import org.openmetadata.schema.type.Permission; import org.openmetadata.schema.type.Permission.Access; import org.openmetadata.schema.type.ResourceDescriptor; import org.openmetadata.schema.type.ResourcePermission; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.ResourceRegistry; import org.openmetadata.service.exception.CatalogExceptionMessage; import org.openmetadata.service.resources.EntityResourceTest; @@ -72,7 +72,7 @@ import org.openmetadata.service.util.TestUtils; @Slf4j @TestInstance(TestInstance.Lifecycle.PER_CLASS) -class PermissionsResourceTest extends CatalogApplicationTest { +class PermissionsResourceTest extends OpenMetadataApplicationTest { private static final String ORG_POLICY_NAME = "OrganizationPolicy"; private static List ORG_RULES; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/pipelines/PipelineResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/pipelines/PipelineResourceTest.java index e3fc2007a22..30ec9f23bfc 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/pipelines/PipelineResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/pipelines/PipelineResourceTest.java @@ -57,8 +57,8 @@ import org.openmetadata.schema.type.FieldChange; import org.openmetadata.schema.type.Status; import org.openmetadata.schema.type.StatusType; import org.openmetadata.schema.type.Task; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.EntityResourceTest; import org.openmetadata.service.resources.pipelines.PipelineResource.PipelineList; import org.openmetadata.service.util.FullyQualifiedName; @@ -545,19 +545,19 @@ public class PipelineResourceTest extends EntityResourceTest authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("pipelines/" + fqn + "/status"); + WebTarget target = OpenMetadataApplicationTest.getResource("pipelines/" + fqn + "/status"); return TestUtils.put(target, data, Pipeline.class, OK, authHeaders); } public static Pipeline deletePipelineStatus(String fqn, Long timestamp, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("pipelines/" + fqn + "/status/" + timestamp); + WebTarget target = OpenMetadataApplicationTest.getResource("pipelines/" + fqn + "/status/" + timestamp); return TestUtils.delete(target, Pipeline.class, authHeaders); } public static ResultList getPipelineStatues( String fqn, Integer limit, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("pipelines/" + fqn + "/status"); + WebTarget target = OpenMetadataApplicationTest.getResource("pipelines/" + fqn + "/status"); target = limit != null ? target.queryParam("limit", limit) : target; return TestUtils.get(target, PipelineResource.PipelineStatusList.class, authHeaders); } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResourceUnitTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResourceUnitTest.java index dee482e6006..387a9bb9fa3 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResourceUnitTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/services/ingestionpipelines/IngestionPipelineResourceUnitTest.java @@ -51,8 +51,8 @@ import org.openmetadata.schema.entity.services.ingestionPipelines.PipelineType; import org.openmetadata.schema.metadataIngestion.DatabaseServiceMetadataPipeline; import org.openmetadata.schema.metadataIngestion.SourceConfig; import org.openmetadata.schema.type.EntityReference; -import org.openmetadata.service.CatalogApplicationConfig; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.airflow.AirflowRESTClient; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.EntityDAO; @@ -76,7 +76,7 @@ public class IngestionPipelineResourceUnitTest { @Mock CollectionDAO collectionDAO; - @Mock CatalogApplicationConfig catalogApplicationConfig; + @Mock OpenMetadataApplicationConfig openMetadataApplicationConfig; @Mock SecretsManager secretsManager; @@ -105,7 +105,7 @@ public class IngestionPipelineResourceUnitTest { Map expectedMap = Map.of("task", "log"); try (MockedConstruction mocked = mockConstruction(AirflowRESTClient.class, this::preparePipelineServiceClient)) { - ingestionPipelineResource.initialize(catalogApplicationConfig); + ingestionPipelineResource.initialize(openMetadataApplicationConfig); assertEquals( expectedMap, ingestionPipelineResource.getLastIngestionLogs(null, securityContext, DAG_ID).getEntity()); PipelineServiceClient client = mocked.constructed().get(0); @@ -118,7 +118,7 @@ public class IngestionPipelineResourceUnitTest { TestServiceConnection testServiceConnection = new TestServiceConnection(); try (MockedConstruction mocked = mockConstruction(AirflowRESTClient.class, this::preparePipelineServiceClient)) { - ingestionPipelineResource.initialize(catalogApplicationConfig); + ingestionPipelineResource.initialize(openMetadataApplicationConfig); PipelineServiceClient client = mocked.constructed().get(0); HttpResponse httpResponse = mock(HttpResponse.class); when(client.testConnection(any())).thenReturn(httpResponse); diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/tags/TagResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/tags/TagResourceTest.java index d25d2c65ade..2b3ee6f6a97 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/tags/TagResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/tags/TagResourceTest.java @@ -50,8 +50,8 @@ import org.openmetadata.schema.api.tags.CreateTagCategory.TagCategoryType; import org.openmetadata.schema.entity.tags.Tag; import org.openmetadata.schema.type.TagCategory; import org.openmetadata.schema.type.TagLabel; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.EntityResourceTest; import org.openmetadata.service.resources.tags.TagResource.CategoryList; import org.openmetadata.service.util.EntityUtil; @@ -62,7 +62,7 @@ import org.openmetadata.service.util.TestUtils; /** Tests not covered here: Tag category and Tag usage counts are covered in TableResourceTest */ @Slf4j @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class TagResourceTest extends CatalogApplicationTest { +public class TagResourceTest extends OpenMetadataApplicationTest { public static String TAGS_URL; public static TagCategory USER_TAG_CATEGORY; public static Tag ADDRESS_TAG; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/topics/TopicResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/topics/TopicResourceTest.java index 1c2ab7b8e47..c0b42ab37b6 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/topics/TopicResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/topics/TopicResourceTest.java @@ -44,8 +44,8 @@ import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.topic.CleanupPolicy; import org.openmetadata.schema.type.topic.SchemaType; import org.openmetadata.schema.type.topic.TopicSampleData; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.EntityResourceTest; import org.openmetadata.service.resources.topics.TopicResource.TopicList; import org.openmetadata.service.util.JsonUtils; @@ -301,7 +301,7 @@ public class TopicResourceTest extends EntityResourceTest { public static Topic putSampleData(UUID topicId, TopicSampleData data, Map authHeaders) throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("topics/" + topicId + "/sampleData"); + WebTarget target = OpenMetadataApplicationTest.getResource("topics/" + topicId + "/sampleData"); return TestUtils.put(target, data, Topic.class, OK, authHeaders); } } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/usage/UsageResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/usage/UsageResourceTest.java index 787039ce8ba..49d2316f172 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/usage/UsageResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/usage/UsageResourceTest.java @@ -50,8 +50,8 @@ import org.openmetadata.schema.entity.data.Table; import org.openmetadata.schema.type.DailyCount; import org.openmetadata.schema.type.EntityUsage; import org.openmetadata.schema.type.UsageDetails; -import org.openmetadata.service.CatalogApplicationTest; import org.openmetadata.service.Entity; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.databases.DatabaseResourceTest; import org.openmetadata.service.resources.databases.TableResourceTest; import org.openmetadata.service.util.RestUtil; @@ -59,7 +59,7 @@ import org.openmetadata.service.util.TestUtils; @Slf4j @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class UsageResourceTest extends CatalogApplicationTest { +class UsageResourceTest extends OpenMetadataApplicationTest { private static final String PUT = "PUT"; private static final String POST = "POST"; public static final List
TABLES = new ArrayList<>(); diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/util/UtilResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/util/UtilResourceTest.java index 923c69a0ae7..c0c0e15349f 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/util/UtilResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/util/UtilResourceTest.java @@ -28,7 +28,7 @@ import org.openmetadata.schema.api.tests.CreateTestSuite; import org.openmetadata.schema.entity.data.Table; import org.openmetadata.schema.util.EntitiesCount; import org.openmetadata.schema.util.ServicesCount; -import org.openmetadata.service.CatalogApplicationTest; +import org.openmetadata.service.OpenMetadataApplicationTest; import org.openmetadata.service.resources.EntityResourceTest; import org.openmetadata.service.resources.dashboards.DashboardResourceTest; import org.openmetadata.service.resources.databases.TableResourceTest; @@ -46,7 +46,7 @@ import org.openmetadata.service.util.TestUtils; @Slf4j @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class UtilResourceTest extends CatalogApplicationTest { +public class UtilResourceTest extends OpenMetadataApplicationTest { @BeforeAll public static void setup(TestInfo test) throws IOException, URISyntaxException { @@ -55,12 +55,12 @@ public class UtilResourceTest extends CatalogApplicationTest { } public static EntitiesCount getEntitiesCount() throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("util/entities/count"); + WebTarget target = OpenMetadataApplicationTest.getResource("util/entities/count"); return TestUtils.get(target, EntitiesCount.class, ADMIN_AUTH_HEADERS); } public static ServicesCount getServicesCount() throws HttpResponseException { - WebTarget target = CatalogApplicationTest.getResource("util/services/count"); + WebTarget target = OpenMetadataApplicationTest.getResource("util/services/count"); return TestUtils.get(target, ServicesCount.class, ADMIN_AUTH_HEADERS); } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/validators/AirflowConfigValidationTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/validators/AirflowConfigValidationTest.java index b2931a37fee..34234c4b805 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/validators/AirflowConfigValidationTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/validators/AirflowConfigValidationTest.java @@ -12,7 +12,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.openmetadata.api.configuration.airflow.AuthConfiguration; import org.openmetadata.schema.services.connections.metadata.OpenMetadataServerConnection; -import org.openmetadata.service.CatalogApplicationConfig; +import org.openmetadata.service.OpenMetadataApplicationConfig; import org.openmetadata.service.fixtures.ConfigurationFixtures; public class AirflowConfigValidationTest { @@ -27,31 +27,33 @@ public class AirflowConfigValidationTest { @Test void testOpenMetadataGoogleClientConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.GOOGLE); - catalogApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildGoogleAuthConfig()); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig(OpenMetadataServerConnection.AuthProvider.GOOGLE); + openMetadataApplicationConfig + .getAirflowConfiguration() + .setAuthConfig(ConfigurationFixtures.buildGoogleAuthConfig()); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(0, violations.size()); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getGoogle().setSecretKey(""); - violations = new ArrayList<>(validator.validate(catalogApplicationConfig)); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getGoogle().setSecretKey(""); + violations = new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(1, violations.size()); assertEquals("\ngoogle SSO client config requires secretKey", violations.get(0).getMessage()); } @Test void testOpenMetadataOktaClientConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.OKTA); - catalogApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildOktaAuthConfig()); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig(OpenMetadataServerConnection.AuthProvider.OKTA); + openMetadataApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildOktaAuthConfig()); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(0, violations.size()); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getOkta().setClientId(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getOkta().setPrivateKey(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getOkta().setEmail(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getOkta().setOrgURL(""); - violations = new ArrayList<>(validator.validate(catalogApplicationConfig)); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getOkta().setClientId(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getOkta().setPrivateKey(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getOkta().setEmail(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getOkta().setOrgURL(""); + violations = new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(1, violations.size()); assertEquals( "\nokta SSO client config requires clientId\n" @@ -63,16 +65,16 @@ public class AirflowConfigValidationTest { @Test void testOpenMetadataAuth0ClientConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.AUTH_0); - catalogApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildAuth0Config()); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig(OpenMetadataServerConnection.AuthProvider.AUTH_0); + openMetadataApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildAuth0Config()); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(0, violations.size()); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getAuth0().setClientId(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getAuth0().setSecretKey(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getAuth0().setDomain(""); - violations = new ArrayList<>(validator.validate(catalogApplicationConfig)); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getAuth0().setClientId(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getAuth0().setSecretKey(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getAuth0().setDomain(""); + violations = new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(1, violations.size()); assertEquals( "\nauth0 SSO client config requires clientId\n" @@ -83,17 +85,17 @@ public class AirflowConfigValidationTest { @Test void testOpenMetadataAzureClientConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.AZURE); - catalogApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildAzureAuthConfig()); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig(OpenMetadataServerConnection.AuthProvider.AZURE); + openMetadataApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildAzureAuthConfig()); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(0, violations.size()); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getAzure().setClientId(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getAzure().setClientSecret(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getAzure().setAuthority(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getAzure().setScopes(List.of()); - violations = new ArrayList<>(validator.validate(catalogApplicationConfig)); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getAzure().setClientId(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getAzure().setClientSecret(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getAzure().setAuthority(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getAzure().setScopes(List.of()); + violations = new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(1, violations.size()); assertEquals( "\nazure SSO client config requires clientId\n" @@ -105,16 +107,18 @@ public class AirflowConfigValidationTest { @Test void testOpenMetadataCustomOIDCClientConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.CUSTOM_OIDC); - catalogApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildCustomOIDCConfig()); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig(OpenMetadataServerConnection.AuthProvider.CUSTOM_OIDC); + openMetadataApplicationConfig + .getAirflowConfiguration() + .setAuthConfig(ConfigurationFixtures.buildCustomOIDCConfig()); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(0, violations.size()); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setClientId(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setSecretKey(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setTokenEndpoint(""); - violations = new ArrayList<>(validator.validate(catalogApplicationConfig)); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setClientId(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setSecretKey(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setTokenEndpoint(""); + violations = new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(1, violations.size()); assertEquals( "\ncustom-oidc SSO client config requires clientId\n" @@ -125,16 +129,18 @@ public class AirflowConfigValidationTest { @Test void testOpenMetadataNoAuthClientConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.CUSTOM_OIDC); - catalogApplicationConfig.getAirflowConfiguration().setAuthConfig(ConfigurationFixtures.buildCustomOIDCConfig()); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig(OpenMetadataServerConnection.AuthProvider.CUSTOM_OIDC); + openMetadataApplicationConfig + .getAirflowConfiguration() + .setAuthConfig(ConfigurationFixtures.buildCustomOIDCConfig()); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(0, violations.size()); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setClientId(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setSecretKey(""); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setTokenEndpoint(""); - violations = new ArrayList<>(validator.validate(catalogApplicationConfig)); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setClientId(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setSecretKey(""); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getCustomOidc().setTokenEndpoint(""); + violations = new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(1, violations.size()); assertEquals( "\ncustom-oidc SSO client config requires clientId\n" @@ -145,37 +151,38 @@ public class AirflowConfigValidationTest { @Test void testOpenMetadataOpenmetadataClientConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.OPENMETADATA); - catalogApplicationConfig + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig( + OpenMetadataServerConnection.AuthProvider.OPENMETADATA); + openMetadataApplicationConfig .getAirflowConfiguration() .setAuthConfig(ConfigurationFixtures.buildOpenmetadataAuthConfig()); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(0, violations.size()); - catalogApplicationConfig.getAirflowConfiguration().getAuthConfig().getOpenmetadata().setJwtToken(""); - violations = new ArrayList<>(validator.validate(catalogApplicationConfig)); + openMetadataApplicationConfig.getAirflowConfiguration().getAuthConfig().getOpenmetadata().setJwtToken(""); + violations = new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(1, violations.size()); assertEquals("\nopenmetadata SSO client config requires jwtToken", violations.get(0).getMessage()); } @Test void testNoAuthClientConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.NO_AUTH); - catalogApplicationConfig.getAirflowConfiguration().setAuthConfig(new AuthConfiguration()); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig(OpenMetadataServerConnection.AuthProvider.NO_AUTH); + openMetadataApplicationConfig.getAirflowConfiguration().setAuthConfig(new AuthConfiguration()); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(0, violations.size()); } @Test void testAuthClientConfiguredWithoutConfigValidation() { - CatalogApplicationConfig catalogApplicationConfig = - ConfigurationFixtures.buildCatalogApplicationConfig(OpenMetadataServerConnection.AuthProvider.GOOGLE); - catalogApplicationConfig.getAirflowConfiguration().setAuthConfig(null); - List> violations = - new ArrayList<>(validator.validate(catalogApplicationConfig)); + OpenMetadataApplicationConfig openMetadataApplicationConfig = + ConfigurationFixtures.buildOpenMetadataApplicationConfig(OpenMetadataServerConnection.AuthProvider.GOOGLE); + openMetadataApplicationConfig.getAirflowConfiguration().setAuthConfig(null); + List> violations = + new ArrayList<>(validator.validate(openMetadataApplicationConfig)); assertEquals(1, violations.size()); assertEquals("\ngoogle SSO client config requires authConfig section", violations.get(0).getMessage()); }