mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-26 17:34:41 +00:00
This commit is contained in:
parent
d7e309939e
commit
69adc7ed38
@ -227,7 +227,9 @@ public class CatalogApplication extends Application<CatalogApplicationConfig> {
|
|||||||
|
|
||||||
private void registerResources(CatalogApplicationConfig config, Environment environment, Jdbi jdbi) {
|
private void registerResources(CatalogApplicationConfig config, Environment environment, Jdbi jdbi) {
|
||||||
CollectionRegistry.getInstance().registerResources(jdbi, environment, config, authorizer);
|
CollectionRegistry.getInstance().registerResources(jdbi, environment, config, authorizer);
|
||||||
|
if (config.getElasticSearchConfiguration() != null) {
|
||||||
environment.jersey().register(new SearchResource(config.getElasticSearchConfiguration()));
|
environment.jersey().register(new SearchResource(config.getElasticSearchConfiguration()));
|
||||||
|
}
|
||||||
environment.jersey().register(new JsonPatchProvider());
|
environment.jersey().register(new JsonPatchProvider());
|
||||||
ErrorPageErrorHandler eph = new ErrorPageErrorHandler();
|
ErrorPageErrorHandler eph = new ErrorPageErrorHandler();
|
||||||
eph.addErrorPage(Response.Status.NOT_FOUND.getStatusCode(), "/");
|
eph.addErrorPage(Response.Status.NOT_FOUND.getStatusCode(), "/");
|
||||||
|
@ -44,10 +44,7 @@ public class AirflowPipelineRepository extends EntityRepository<AirflowPipeline>
|
|||||||
dao.airflowPipelineDAO(),
|
dao.airflowPipelineDAO(),
|
||||||
dao,
|
dao,
|
||||||
AIRFLOW_PIPELINE_PATCH_FIELDS,
|
AIRFLOW_PIPELINE_PATCH_FIELDS,
|
||||||
AIRFLOW_PIPELINE_UPDATE_FIELDS,
|
AIRFLOW_PIPELINE_UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFQN(AirflowPipeline airflowPipeline) {
|
public static String getFQN(AirflowPipeline airflowPipeline) {
|
||||||
|
@ -33,10 +33,7 @@ public class BotsRepository extends EntityRepository<Bots> {
|
|||||||
dao.botsDAO(),
|
dao.botsDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS);
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,10 +49,7 @@ public class ChartRepository extends EntityRepository<Chart> {
|
|||||||
dao.chartDAO(),
|
dao.chartDAO(),
|
||||||
dao,
|
dao,
|
||||||
CHART_PATCH_FIELDS,
|
CHART_PATCH_FIELDS,
|
||||||
CHART_UPDATE_FIELDS,
|
CHART_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFQN(Chart chart) {
|
public static String getFQN(Chart chart) {
|
||||||
|
@ -53,10 +53,7 @@ public class DashboardRepository extends EntityRepository<Dashboard> {
|
|||||||
dao.dashboardDAO(),
|
dao.dashboardDAO(),
|
||||||
dao,
|
dao,
|
||||||
DASHBOARD_PATCH_FIELDS,
|
DASHBOARD_PATCH_FIELDS,
|
||||||
DASHBOARD_UPDATE_FIELDS,
|
DASHBOARD_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFQN(Dashboard dashboard) {
|
public static String getFQN(Dashboard dashboard) {
|
||||||
|
@ -41,10 +41,7 @@ public class DashboardServiceRepository extends EntityRepository<DashboardServic
|
|||||||
dao.dashboardServiceDAO(),
|
dao.dashboardServiceDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
UPDATE_FIELDS,
|
UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,10 +50,7 @@ public class DatabaseRepository extends EntityRepository<Database> {
|
|||||||
dao.databaseDAO(),
|
dao.databaseDAO(),
|
||||||
dao,
|
dao,
|
||||||
DATABASE_PATCH_FIELDS,
|
DATABASE_PATCH_FIELDS,
|
||||||
DATABASE_UPDATE_FIELDS,
|
DATABASE_UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFQN(Database database) {
|
public static String getFQN(Database database) {
|
||||||
|
@ -50,10 +50,7 @@ public class DatabaseServiceRepository extends EntityRepository<DatabaseService>
|
|||||||
dao.dbServiceDAO(),
|
dao.dbServiceDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
UPDATE_FIELDS,
|
UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
fernet = Fernet.getInstance();
|
fernet = Fernet.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ package org.openmetadata.catalog.jdbi3;
|
|||||||
|
|
||||||
import static org.openmetadata.catalog.Entity.FIELD_DESCRIPTION;
|
import static org.openmetadata.catalog.Entity.FIELD_DESCRIPTION;
|
||||||
import static org.openmetadata.catalog.Entity.FIELD_OWNER;
|
import static org.openmetadata.catalog.Entity.FIELD_OWNER;
|
||||||
|
import static org.openmetadata.catalog.Entity.getEntityFields;
|
||||||
import static org.openmetadata.catalog.type.Include.DELETED;
|
import static org.openmetadata.catalog.type.Include.DELETED;
|
||||||
import static org.openmetadata.catalog.util.EntityUtil.compareTagLabel;
|
import static org.openmetadata.catalog.util.EntityUtil.compareTagLabel;
|
||||||
import static org.openmetadata.catalog.util.EntityUtil.entityReferenceMatch;
|
import static org.openmetadata.catalog.util.EntityUtil.entityReferenceMatch;
|
||||||
@ -131,10 +132,7 @@ public abstract class EntityRepository<T> {
|
|||||||
EntityDAO<T> entityDAO,
|
EntityDAO<T> entityDAO,
|
||||||
CollectionDAO collectionDAO,
|
CollectionDAO collectionDAO,
|
||||||
Fields patchFields,
|
Fields patchFields,
|
||||||
Fields putFields,
|
Fields putFields) {
|
||||||
boolean supportsTags,
|
|
||||||
boolean supportsOwner,
|
|
||||||
boolean supportsFollower) {
|
|
||||||
this.collectionPath = collectionPath;
|
this.collectionPath = collectionPath;
|
||||||
this.entityClass = entityClass;
|
this.entityClass = entityClass;
|
||||||
this.dao = entityDAO;
|
this.dao = entityDAO;
|
||||||
@ -142,9 +140,11 @@ public abstract class EntityRepository<T> {
|
|||||||
this.patchFields = patchFields;
|
this.patchFields = patchFields;
|
||||||
this.putFields = putFields;
|
this.putFields = putFields;
|
||||||
this.entityType = entityType;
|
this.entityType = entityType;
|
||||||
this.supportsTags = supportsTags;
|
|
||||||
this.supportsOwner = supportsOwner;
|
List<String> allowedFields = getEntityFields(entityClass);
|
||||||
this.supportsFollower = supportsFollower;
|
this.supportsTags = allowedFields.contains("tags");
|
||||||
|
this.supportsOwner = allowedFields.contains("owner");
|
||||||
|
this.supportsFollower = allowedFields.contains("followers");
|
||||||
Entity.registerEntity(entityClass, entityType, dao, this);
|
Entity.registerEntity(entityClass, entityType, dao, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,10 +51,7 @@ public class GlossaryRepository extends EntityRepository<Glossary> {
|
|||||||
dao.glossaryDAO(),
|
dao.glossaryDAO(),
|
||||||
dao,
|
dao,
|
||||||
PATCH_FIELDS,
|
PATCH_FIELDS,
|
||||||
UPDATE_FIELDS,
|
UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transaction
|
@Transaction
|
||||||
|
@ -58,10 +58,7 @@ public class GlossaryTermRepository extends EntityRepository<GlossaryTerm> {
|
|||||||
dao.glossaryTermDAO(),
|
dao.glossaryTermDAO(),
|
||||||
dao,
|
dao,
|
||||||
PATCH_FIELDS,
|
PATCH_FIELDS,
|
||||||
UPDATE_FIELDS,
|
UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -54,10 +54,7 @@ public class LocationRepository extends EntityRepository<Location> {
|
|||||||
dao.locationDAO(),
|
dao.locationDAO(),
|
||||||
dao,
|
dao,
|
||||||
LOCATION_PATCH_FIELDS,
|
LOCATION_PATCH_FIELDS,
|
||||||
LOCATION_UPDATE_FIELDS,
|
LOCATION_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -42,10 +42,7 @@ public class MessagingServiceRepository extends EntityRepository<MessagingServic
|
|||||||
dao.messagingServiceDAO(),
|
dao.messagingServiceDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
UPDATE_FIELDS,
|
UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,10 +44,7 @@ public class MetricsRepository extends EntityRepository<Metrics> {
|
|||||||
dao.metricsDAO(),
|
dao.metricsDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
METRICS_UPDATE_FIELDS,
|
METRICS_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFQN(Metrics metrics) {
|
public static String getFQN(Metrics metrics) {
|
||||||
|
@ -56,10 +56,7 @@ public class MlModelRepository extends EntityRepository<MlModel> {
|
|||||||
dao.mlModelDAO(),
|
dao.mlModelDAO(),
|
||||||
dao,
|
dao,
|
||||||
MODEL_PATCH_FIELDS,
|
MODEL_PATCH_FIELDS,
|
||||||
MODEL_UPDATE_FIELDS,
|
MODEL_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFQN(MlModel model) {
|
public static String getFQN(MlModel model) {
|
||||||
|
@ -59,10 +59,7 @@ public class PipelineRepository extends EntityRepository<Pipeline> {
|
|||||||
dao.pipelineDAO(),
|
dao.pipelineDAO(),
|
||||||
dao,
|
dao,
|
||||||
PIPELINE_PATCH_FIELDS,
|
PIPELINE_PATCH_FIELDS,
|
||||||
PIPELINE_UPDATE_FIELDS,
|
PIPELINE_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFQN(Pipeline pipeline) {
|
public static String getFQN(Pipeline pipeline) {
|
||||||
|
@ -39,10 +39,7 @@ public class PipelineServiceRepository extends EntityRepository<PipelineService>
|
|||||||
dao.pipelineServiceDAO(),
|
dao.pipelineServiceDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
UPDATE_FIELDS,
|
UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,10 +62,7 @@ public class PolicyRepository extends EntityRepository<Policy> {
|
|||||||
dao.policyDAO(),
|
dao.policyDAO(),
|
||||||
dao,
|
dao,
|
||||||
POLICY_PATCH_FIELDS,
|
POLICY_PATCH_FIELDS,
|
||||||
POLICY_UPDATE_FIELDS,
|
POLICY_UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
policyEvaluator = PolicyEvaluator.getInstance();
|
policyEvaluator = PolicyEvaluator.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,10 +44,7 @@ public class ReportRepository extends EntityRepository<Report> {
|
|||||||
dao.reportDAO(),
|
dao.reportDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
REPORT_UPDATE_FIELDS,
|
REPORT_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,10 +59,7 @@ public class RoleRepository extends EntityRepository<Role> {
|
|||||||
dao.roleDAO(),
|
dao.roleDAO(),
|
||||||
dao,
|
dao,
|
||||||
ROLE_PATCH_FIELDS,
|
ROLE_PATCH_FIELDS,
|
||||||
ROLE_UPDATE_FIELDS,
|
ROLE_UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,10 +38,7 @@ public class StorageServiceRepository extends EntityRepository<StorageService> {
|
|||||||
dao.storageServiceDAO(),
|
dao.storageServiceDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
UPDATE_FIELDS,
|
UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -93,10 +93,7 @@ public class TableRepository extends EntityRepository<Table> {
|
|||||||
dao.tableDAO(),
|
dao.tableDAO(),
|
||||||
dao,
|
dao,
|
||||||
TABLE_PATCH_FIELDS,
|
TABLE_PATCH_FIELDS,
|
||||||
TABLE_UPDATE_FIELDS,
|
TABLE_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,10 +44,7 @@ public class TeamRepository extends EntityRepository<Team> {
|
|||||||
dao.teamDAO(),
|
dao.teamDAO(),
|
||||||
dao,
|
dao,
|
||||||
TEAM_PATCH_FIELDS,
|
TEAM_PATCH_FIELDS,
|
||||||
TEAM_UPDATE_FIELDS,
|
TEAM_UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EntityReference> getEntityReferences(List<UUID> ids) {
|
public List<EntityReference> getEntityReferences(List<UUID> ids) {
|
||||||
|
@ -56,10 +56,7 @@ public class TopicRepository extends EntityRepository<Topic> {
|
|||||||
dao.topicDAO(),
|
dao.topicDAO(),
|
||||||
dao,
|
dao,
|
||||||
TOPIC_PATCH_FIELDS,
|
TOPIC_PATCH_FIELDS,
|
||||||
TOPIC_UPDATE_FIELDS,
|
TOPIC_UPDATE_FIELDS);
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transaction
|
@Transaction
|
||||||
|
@ -52,10 +52,7 @@ public class UserRepository extends EntityRepository<User> {
|
|||||||
dao.userDAO(),
|
dao.userDAO(),
|
||||||
dao,
|
dao,
|
||||||
USER_PATCH_FIELDS,
|
USER_PATCH_FIELDS,
|
||||||
USER_UPDATE_FIELDS,
|
USER_UPDATE_FIELDS);
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -70,10 +70,7 @@ public class WebhookRepository extends EntityRepository<Webhook> {
|
|||||||
dao.webhookDAO(),
|
dao.webhookDAO(),
|
||||||
dao,
|
dao,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS,
|
||||||
Fields.EMPTY_FIELDS,
|
Fields.EMPTY_FIELDS);
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package org.openmetadata.catalog.resources;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.openmetadata.catalog.Entity;
|
||||||
|
import org.openmetadata.catalog.jdbi3.EntityRepository;
|
||||||
|
|
||||||
|
public class EntityResource<T, K extends EntityRepository<T>> {
|
||||||
|
protected final List<String> allowedFields;
|
||||||
|
|
||||||
|
public EntityResource(Class<T> entityClass, EntityRepository<T> repository) {
|
||||||
|
allowedFields = Entity.getEntityFields(entityClass);
|
||||||
|
}
|
||||||
|
}
|
@ -24,23 +24,8 @@ public abstract class EntityOperationsResourceTest<T, K> extends EntityResourceT
|
|||||||
Class<T> entityClass,
|
Class<T> entityClass,
|
||||||
Class<? extends ResultList<T>> entityListClass,
|
Class<? extends ResultList<T>> entityListClass,
|
||||||
String collectionName,
|
String collectionName,
|
||||||
String fields,
|
String fields) {
|
||||||
boolean supportsFollowers,
|
super(entityType, entityClass, entityListClass, collectionName, fields);
|
||||||
boolean supportsOwner,
|
|
||||||
boolean supportsTags,
|
|
||||||
boolean supportsAuthorizedMetadataOperations,
|
|
||||||
boolean supportsDots) {
|
|
||||||
super(
|
|
||||||
entityType,
|
|
||||||
entityClass,
|
|
||||||
entityListClass,
|
|
||||||
collectionName,
|
|
||||||
fields,
|
|
||||||
supportsFollowers,
|
|
||||||
supportsOwner,
|
|
||||||
supportsTags,
|
|
||||||
supportsAuthorizedMetadataOperations,
|
|
||||||
supportsDots);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Override the resource path name of regular entities api/v1/<entities> to api/operations/v1/<operations>
|
// Override the resource path name of regular entities api/v1/<entities> to api/operations/v1/<operations>
|
||||||
|
@ -160,13 +160,13 @@ public abstract class EntityResourceTest<T, K> extends CatalogApplicationTest {
|
|||||||
private final Class<? extends ResultList<T>> entityListClass;
|
private final Class<? extends ResultList<T>> entityListClass;
|
||||||
protected final String collectionName;
|
protected final String collectionName;
|
||||||
private final String allFields;
|
private final String allFields;
|
||||||
private final boolean supportsFollowers;
|
protected final boolean supportsFollowers;
|
||||||
private final boolean supportsOwner;
|
protected boolean supportsOwner;
|
||||||
private final boolean supportsTags;
|
protected final boolean supportsTags;
|
||||||
private final boolean supportsDots;
|
protected boolean supportsDots = true;
|
||||||
protected boolean supportsPatch = true;
|
protected boolean supportsPatch = true;
|
||||||
protected boolean supportsSoftDelete = true;
|
protected boolean supportsSoftDelete = true;
|
||||||
private final boolean supportsAuthorizedMetadataOperations;
|
protected boolean supportsAuthorizedMetadataOperations = true;
|
||||||
protected boolean supportsFieldsQueryParam = true;
|
protected boolean supportsFieldsQueryParam = true;
|
||||||
|
|
||||||
public static final String DATA_STEWARD_ROLE_NAME = "DataSteward";
|
public static final String DATA_STEWARD_ROLE_NAME = "DataSteward";
|
||||||
@ -234,32 +234,27 @@ public abstract class EntityResourceTest<T, K> extends CatalogApplicationTest {
|
|||||||
public static boolean runWebhookTests;
|
public static boolean runWebhookTests;
|
||||||
|
|
||||||
public EntityResourceTest(
|
public EntityResourceTest(
|
||||||
String entityTYpe,
|
String entityType,
|
||||||
Class<T> entityClass,
|
Class<T> entityClass,
|
||||||
Class<? extends ResultList<T>> entityListClass,
|
Class<? extends ResultList<T>> entityListClass,
|
||||||
String collectionName,
|
String collectionName,
|
||||||
String fields,
|
String fields) {
|
||||||
boolean supportsFollowers,
|
this.entityType = entityType;
|
||||||
boolean supportsOwner,
|
|
||||||
boolean supportsTags,
|
|
||||||
boolean supportsAuthorizedMetadataOperations,
|
|
||||||
boolean supportsDots) {
|
|
||||||
|
|
||||||
this.entityType = entityTYpe;
|
|
||||||
this.entityClass = entityClass;
|
this.entityClass = entityClass;
|
||||||
this.entityListClass = entityListClass;
|
this.entityListClass = entityListClass;
|
||||||
this.collectionName = collectionName;
|
this.collectionName = collectionName;
|
||||||
this.allFields = fields;
|
this.allFields = fields;
|
||||||
this.supportsFollowers = supportsFollowers;
|
|
||||||
this.supportsOwner = supportsOwner;
|
List<String> allowedFields = Entity.getEntityFields(entityClass);
|
||||||
this.supportsTags = supportsTags;
|
this.supportsFollowers = allowedFields.contains("followers");
|
||||||
this.supportsAuthorizedMetadataOperations = supportsAuthorizedMetadataOperations;
|
this.supportsOwner = allowedFields.contains("owner");
|
||||||
this.supportsDots = supportsDots;
|
this.supportsTags = allowedFields.contains("tags");
|
||||||
ENTITY_RESOURCE_TEST_MAP.put(entityTYpe, this);
|
ENTITY_RESOURCE_TEST_MAP.put(entityType, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public void setup(TestInfo test) throws URISyntaxException, IOException {
|
public void setup(TestInfo test) throws URISyntaxException, IOException {
|
||||||
|
|
||||||
runWebhookTests = new Random().nextBoolean();
|
runWebhookTests = new Random().nextBoolean();
|
||||||
if (runWebhookTests) {
|
if (runWebhookTests) {
|
||||||
webhookCallbackResource.clearEvents();
|
webhookCallbackResource.clearEvents();
|
||||||
|
@ -46,7 +46,7 @@ import org.openmetadata.catalog.util.TestUtils;
|
|||||||
public class ChartResourceTest extends EntityResourceTest<Chart, CreateChart> {
|
public class ChartResourceTest extends EntityResourceTest<Chart, CreateChart> {
|
||||||
|
|
||||||
public ChartResourceTest() {
|
public ChartResourceTest() {
|
||||||
super(Entity.CHART, Chart.class, ChartList.class, "charts", ChartResource.FIELDS, true, true, true, true, true);
|
super(Entity.CHART, Chart.class, ChartList.class, "charts", ChartResource.FIELDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -59,17 +59,7 @@ public class DashboardResourceTest extends EntityResourceTest<Dashboard, CreateD
|
|||||||
public static EntityReference SUPERSET_INVALID_SERVICE_REFERENCE;
|
public static EntityReference SUPERSET_INVALID_SERVICE_REFERENCE;
|
||||||
|
|
||||||
public DashboardResourceTest() {
|
public DashboardResourceTest() {
|
||||||
super(
|
super(Entity.DASHBOARD, Dashboard.class, DashboardList.class, "dashboards", DashboardResource.FIELDS);
|
||||||
Entity.DASHBOARD,
|
|
||||||
Dashboard.class,
|
|
||||||
DashboardList.class,
|
|
||||||
"dashboards",
|
|
||||||
DashboardResource.FIELDS,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -48,17 +48,7 @@ import org.openmetadata.catalog.util.TestUtils;
|
|||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
public class DatabaseResourceTest extends EntityResourceTest<Database, CreateDatabase> {
|
public class DatabaseResourceTest extends EntityResourceTest<Database, CreateDatabase> {
|
||||||
public DatabaseResourceTest() {
|
public DatabaseResourceTest() {
|
||||||
super(
|
super(Entity.DATABASE, Database.class, DatabaseList.class, "databases", DatabaseResource.FIELDS);
|
||||||
Entity.DATABASE,
|
|
||||||
Database.class,
|
|
||||||
DatabaseList.class,
|
|
||||||
"databases",
|
|
||||||
DatabaseResource.FIELDS,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -22,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
import static org.openmetadata.catalog.Entity.TABLE;
|
||||||
import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound;
|
import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityNotFound;
|
||||||
import static org.openmetadata.catalog.exception.CatalogExceptionMessage.invalidColumnFQN;
|
import static org.openmetadata.catalog.exception.CatalogExceptionMessage.invalidColumnFQN;
|
||||||
import static org.openmetadata.catalog.type.ColumnDataType.ARRAY;
|
import static org.openmetadata.catalog.type.ColumnDataType.ARRAY;
|
||||||
@ -134,7 +135,7 @@ import org.openmetadata.catalog.util.TestUtils;
|
|||||||
public class TableResourceTest extends EntityResourceTest<Table, CreateTable> {
|
public class TableResourceTest extends EntityResourceTest<Table, CreateTable> {
|
||||||
|
|
||||||
public TableResourceTest() {
|
public TableResourceTest() {
|
||||||
super(Entity.TABLE, Table.class, TableList.class, "tables", TableResource.FIELDS, true, true, true, true, true);
|
super(TABLE, Table.class, TableList.class, "tables", TableResource.FIELDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -64,7 +64,9 @@ public class WebhookResourceTest extends EntityResourceTest<Webhook, CreateWebho
|
|||||||
}
|
}
|
||||||
|
|
||||||
public WebhookResourceTest() {
|
public WebhookResourceTest() {
|
||||||
super(Entity.WEBHOOK, Webhook.class, WebhookList.class, "webhook", "", false, false, false, false, false);
|
super(Entity.WEBHOOK, Webhook.class, WebhookList.class, "webhook", "");
|
||||||
|
supportsDots = false;
|
||||||
|
supportsAuthorizedMetadataOperations = false;
|
||||||
supportsPatch = false;
|
supportsPatch = false;
|
||||||
supportsFieldsQueryParam = false;
|
supportsFieldsQueryParam = false;
|
||||||
}
|
}
|
||||||
|
@ -45,17 +45,8 @@ import org.openmetadata.catalog.util.TestUtils.UpdateType;
|
|||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||||
public class GlossaryResourceTest extends EntityResourceTest<Glossary, CreateGlossary> {
|
public class GlossaryResourceTest extends EntityResourceTest<Glossary, CreateGlossary> {
|
||||||
public GlossaryResourceTest() {
|
public GlossaryResourceTest() {
|
||||||
super(
|
super(Entity.GLOSSARY, Glossary.class, GlossaryResource.GlossaryList.class, "glossaries", GlossaryResource.FIELDS);
|
||||||
Entity.GLOSSARY,
|
supportsDots = false;
|
||||||
Glossary.class,
|
|
||||||
GlossaryResource.GlossaryList.class,
|
|
||||||
"glossaries",
|
|
||||||
GlossaryResource.FIELDS,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -68,12 +68,9 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
|
|||||||
GlossaryTerm.class,
|
GlossaryTerm.class,
|
||||||
GlossaryTermResource.GlossaryTermList.class,
|
GlossaryTermResource.GlossaryTermList.class,
|
||||||
"glossaryTerms",
|
"glossaryTerms",
|
||||||
GlossaryTermResource.FIELDS,
|
GlossaryTermResource.FIELDS);
|
||||||
false,
|
supportsDots = false;
|
||||||
false,
|
supportsAuthorizedMetadataOperations = false; // TODO why?
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Order(0)
|
@Order(0)
|
||||||
|
@ -50,17 +50,7 @@ import org.openmetadata.catalog.util.TestUtils;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class LocationResourceTest extends EntityResourceTest<Location, CreateLocation> {
|
public class LocationResourceTest extends EntityResourceTest<Location, CreateLocation> {
|
||||||
public LocationResourceTest() {
|
public LocationResourceTest() {
|
||||||
super(
|
super(Entity.LOCATION, Location.class, LocationList.class, "locations", LocationResource.FIELDS);
|
||||||
Entity.LOCATION,
|
|
||||||
Location.class,
|
|
||||||
LocationList.class,
|
|
||||||
"locations",
|
|
||||||
LocationResource.FIELDS,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -103,17 +103,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel, CreateMlMod
|
|||||||
new MlHyperParameter().withName("random").withValue("hello"));
|
new MlHyperParameter().withName("random").withValue("hello"));
|
||||||
|
|
||||||
public MlModelResourceTest() {
|
public MlModelResourceTest() {
|
||||||
super(
|
super(Entity.MLMODEL, MlModel.class, MlModelList.class, "mlmodels", MlModelResource.FIELDS);
|
||||||
Entity.MLMODEL,
|
|
||||||
MlModel.class,
|
|
||||||
MlModelList.class,
|
|
||||||
"mlmodels",
|
|
||||||
MlModelResource.FIELDS,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -94,12 +94,7 @@ public class AirflowPipelineResourceTest extends EntityOperationsResourceTest<Ai
|
|||||||
AirflowPipeline.class,
|
AirflowPipeline.class,
|
||||||
AirflowPipelineResource.AirflowPipelineList.class,
|
AirflowPipelineResource.AirflowPipelineList.class,
|
||||||
"airflowPipeline",
|
"airflowPipeline",
|
||||||
AirflowPipelineResource.FIELDS,
|
AirflowPipelineResource.FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -69,17 +69,7 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline, CreatePip
|
|||||||
public static List<Task> TASKS;
|
public static List<Task> TASKS;
|
||||||
|
|
||||||
public PipelineResourceTest() {
|
public PipelineResourceTest() {
|
||||||
super(
|
super(Entity.PIPELINE, Pipeline.class, PipelineList.class, "pipelines", PipelineResource.FIELDS);
|
||||||
Entity.PIPELINE,
|
|
||||||
Pipeline.class,
|
|
||||||
PipelineList.class,
|
|
||||||
"pipelines",
|
|
||||||
PipelineResource.FIELDS,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -67,17 +67,9 @@ public class PolicyResourceTest extends EntityResourceTest<Policy, CreatePolicy>
|
|||||||
private static Location location;
|
private static Location location;
|
||||||
|
|
||||||
public PolicyResourceTest() {
|
public PolicyResourceTest() {
|
||||||
super(
|
super(Entity.POLICY, Policy.class, PolicyList.class, "policies", PolicyResource.FIELDS);
|
||||||
Entity.POLICY,
|
supportsDots = false;
|
||||||
Policy.class,
|
supportsAuthorizedMetadataOperations = false; // TODO why
|
||||||
PolicyList.class,
|
|
||||||
"policies",
|
|
||||||
PolicyResource.FIELDS,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -53,13 +53,10 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
|
|||||||
DashboardService.class,
|
DashboardService.class,
|
||||||
DashboardServiceList.class,
|
DashboardServiceList.class,
|
||||||
"services/dashboardServices",
|
"services/dashboardServices",
|
||||||
"owner",
|
"owner");
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
this.supportsPatch = false;
|
this.supportsPatch = false;
|
||||||
|
this.supportsDots = false;
|
||||||
|
this.supportsAuthorizedMetadataOperations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -70,13 +70,10 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
|
|||||||
DatabaseService.class,
|
DatabaseService.class,
|
||||||
DatabaseServiceList.class,
|
DatabaseServiceList.class,
|
||||||
"services/databaseServices",
|
"services/databaseServices",
|
||||||
"owner",
|
"owner");
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
this.supportsPatch = false;
|
this.supportsPatch = false;
|
||||||
|
this.supportsDots = false;
|
||||||
|
this.supportsAuthorizedMetadataOperations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -68,13 +68,10 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
|
|||||||
MessagingService.class,
|
MessagingService.class,
|
||||||
MessagingServiceList.class,
|
MessagingServiceList.class,
|
||||||
"services/messagingServices",
|
"services/messagingServices",
|
||||||
MessagingServiceResource.FIELDS,
|
MessagingServiceResource.FIELDS);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
supportsPatch = false;
|
supportsPatch = false;
|
||||||
|
supportsDots = false;
|
||||||
|
supportsAuthorizedMetadataOperations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -64,13 +64,10 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
|
|||||||
PipelineService.class,
|
PipelineService.class,
|
||||||
PipelineServiceList.class,
|
PipelineServiceList.class,
|
||||||
"services/pipelineServices",
|
"services/pipelineServices",
|
||||||
"owner",
|
"owner");
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
this.supportsPatch = false;
|
this.supportsPatch = false;
|
||||||
|
this.supportsDots = false;
|
||||||
|
this.supportsAuthorizedMetadataOperations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
@ -37,18 +37,10 @@ import org.openmetadata.catalog.util.TestUtils;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class StorageServiceResourceTest extends EntityResourceTest<StorageService, CreateStorageService> {
|
public class StorageServiceResourceTest extends EntityResourceTest<StorageService, CreateStorageService> {
|
||||||
public StorageServiceResourceTest() {
|
public StorageServiceResourceTest() {
|
||||||
super(
|
super(Entity.STORAGE_SERVICE, StorageService.class, StorageServiceList.class, "services/storageServices", "owner");
|
||||||
Entity.STORAGE_SERVICE,
|
|
||||||
StorageService.class,
|
|
||||||
StorageServiceList.class,
|
|
||||||
"services/storageServices",
|
|
||||||
"owner",
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
this.supportsPatch = false;
|
this.supportsPatch = false;
|
||||||
|
this.supportsDots = false;
|
||||||
|
this.supportsAuthorizedMetadataOperations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -59,7 +59,9 @@ import org.openmetadata.catalog.util.TestUtils;
|
|||||||
public class RoleResourceTest extends EntityResourceTest<Role, CreateRole> {
|
public class RoleResourceTest extends EntityResourceTest<Role, CreateRole> {
|
||||||
|
|
||||||
public RoleResourceTest() {
|
public RoleResourceTest() {
|
||||||
super(Entity.ROLE, Role.class, RoleList.class, "roles", null, false, false, false, false, false);
|
super(Entity.ROLE, Role.class, RoleList.class, "roles", null);
|
||||||
|
this.supportsDots = false;
|
||||||
|
this.supportsAuthorizedMetadataOperations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -75,7 +75,10 @@ public class TeamResourceTest extends EntityResourceTest<Team, CreateTeam> {
|
|||||||
final Profile PROFILE = new Profile().withImages(new ImageList().withImage(URI.create("http://image.com")));
|
final Profile PROFILE = new Profile().withImages(new ImageList().withImage(URI.create("http://image.com")));
|
||||||
|
|
||||||
public TeamResourceTest() {
|
public TeamResourceTest() {
|
||||||
super(Entity.TEAM, Team.class, TeamList.class, "teams", TeamResource.FIELDS, false, false, false, false, false);
|
super(Entity.TEAM, Team.class, TeamList.class, "teams", TeamResource.FIELDS);
|
||||||
|
this.supportsOwner = false; // TODO fix the test failures after removing this
|
||||||
|
this.supportsDots = false;
|
||||||
|
this.supportsAuthorizedMetadataOperations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -91,7 +91,9 @@ public class UserResourceTest extends EntityResourceTest<User, CreateUser> {
|
|||||||
final Profile PROFILE = new Profile().withImages(new ImageList().withImage(URI.create("http://image.com")));
|
final Profile PROFILE = new Profile().withImages(new ImageList().withImage(URI.create("http://image.com")));
|
||||||
|
|
||||||
public UserResourceTest() {
|
public UserResourceTest() {
|
||||||
super(Entity.USER, User.class, UserList.class, "users", UserResource.FIELDS, false, false, false, false, false);
|
super(Entity.USER, User.class, UserList.class, "users", UserResource.FIELDS);
|
||||||
|
this.supportsDots = false;
|
||||||
|
this.supportsAuthorizedMetadataOperations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -52,7 +52,7 @@ import org.openmetadata.catalog.util.TestUtils.UpdateType;
|
|||||||
public class TopicResourceTest extends EntityResourceTest<Topic, CreateTopic> {
|
public class TopicResourceTest extends EntityResourceTest<Topic, CreateTopic> {
|
||||||
|
|
||||||
public TopicResourceTest() {
|
public TopicResourceTest() {
|
||||||
super(Entity.TOPIC, Topic.class, TopicList.class, "topics", TopicResource.FIELDS, true, true, true, true, true);
|
super(Entity.TOPIC, Topic.class, TopicList.class, "topics", TopicResource.FIELDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -107,9 +107,9 @@ database:
|
|||||||
migrationConfiguration:
|
migrationConfiguration:
|
||||||
path: "../bootstrap/sql/mysql"
|
path: "../bootstrap/sql/mysql"
|
||||||
|
|
||||||
elasticsearch:
|
#elasticsearch:
|
||||||
host: localhost
|
# host: localhost
|
||||||
port: 0
|
# port: 0
|
||||||
|
|
||||||
health:
|
health:
|
||||||
delayedShutdownHandlerEnabled: true
|
delayedShutdownHandlerEnabled: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user