mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-18 05:57:17 +00:00
Clean up code issues flagged by IDE (#14585)
This commit is contained in:
parent
85091dc94c
commit
308b4c2096
@ -3790,7 +3790,6 @@ public interface CollectionDAO {
|
|||||||
case PASSWORD_RESET -> JsonUtils.readValue(json, PasswordResetToken.class);
|
case PASSWORD_RESET -> JsonUtils.readValue(json, PasswordResetToken.class);
|
||||||
case REFRESH_TOKEN -> JsonUtils.readValue(json, RefreshToken.class);
|
case REFRESH_TOKEN -> JsonUtils.readValue(json, RefreshToken.class);
|
||||||
case PERSONAL_ACCESS_TOKEN -> JsonUtils.readValue(json, PersonalAccessToken.class);
|
case PERSONAL_ACCESS_TOKEN -> JsonUtils.readValue(json, PersonalAccessToken.class);
|
||||||
default -> throw new IllegalArgumentException("Invalid Token Type.");
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class CommonMigrationOps {
|
public class CommonMigrationOps {
|
||||||
private CommonMigrationOps() {
|
private CommonMigrationOps() {
|
||||||
/** Hidden constructor */
|
/* Hidden constructor */
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final List<MigrationOps> COMMON_OPS =
|
public static final List<MigrationOps> COMMON_OPS =
|
||||||
|
@ -668,7 +668,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
|||||||
UUID id) {
|
UUID id) {
|
||||||
OperationContext operationContext =
|
OperationContext operationContext =
|
||||||
new OperationContext(entityType, MetadataOperation.VIEW_SAMPLE_DATA);
|
new OperationContext(entityType, MetadataOperation.VIEW_SAMPLE_DATA);
|
||||||
ResourceContext resourceContext = getResourceContextById(id);
|
ResourceContext<?> resourceContext = getResourceContextById(id);
|
||||||
authorizer.authorize(securityContext, operationContext, resourceContext);
|
authorizer.authorize(securityContext, operationContext, resourceContext);
|
||||||
boolean authorizePII = authorizer.authorizePII(securityContext, resourceContext.getOwner());
|
boolean authorizePII = authorizer.authorizePII(securityContext, resourceContext.getOwner());
|
||||||
|
|
||||||
@ -809,7 +809,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
|||||||
String fqn) {
|
String fqn) {
|
||||||
OperationContext operationContext =
|
OperationContext operationContext =
|
||||||
new OperationContext(entityType, MetadataOperation.VIEW_DATA_PROFILE);
|
new OperationContext(entityType, MetadataOperation.VIEW_DATA_PROFILE);
|
||||||
ResourceContext resourceContext = getResourceContextByName(fqn);
|
ResourceContext<?> resourceContext = getResourceContextByName(fqn);
|
||||||
authorizer.authorize(securityContext, operationContext, resourceContext);
|
authorizer.authorize(securityContext, operationContext, resourceContext);
|
||||||
boolean authorizePII = authorizer.authorizePII(securityContext, resourceContext.getOwner());
|
boolean authorizePII = authorizer.authorizePII(securityContext, resourceContext.getOwner());
|
||||||
|
|
||||||
|
@ -1319,8 +1319,6 @@ public class ElasticSearchClient implements SearchClient {
|
|||||||
aggregations.getAggregations());
|
aggregations.getAggregations());
|
||||||
case AGGREGATED_USED_VS_UNUSED_ASSETS_SIZE -> new ElasticSearchAggregatedUsedvsUnusedAssetsSizeAggregator(
|
case AGGREGATED_USED_VS_UNUSED_ASSETS_SIZE -> new ElasticSearchAggregatedUsedvsUnusedAssetsSizeAggregator(
|
||||||
aggregations.getAggregations());
|
aggregations.getAggregations());
|
||||||
default -> throw new IllegalArgumentException(
|
|
||||||
String.format("No processor found for chart Type %s ", dataInsightChartType));
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class ChartIndex implements SearchIndex {
|
public record ChartIndex(Chart chart) implements SearchIndex {
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
final Chart chart;
|
|
||||||
|
|
||||||
public ChartIndex(Chart chart) {
|
|
||||||
this.chart = chart;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(chart);
|
Map<String, Object> doc = JsonUtils.getMap(chart);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class ClassificationIndex implements SearchIndex {
|
public record ClassificationIndex(Classification classification) implements SearchIndex {
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
final Classification classification;
|
|
||||||
|
|
||||||
public ClassificationIndex(Classification classification) {
|
|
||||||
this.classification = classification;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(classification);
|
Map<String, Object> doc = JsonUtils.getMap(classification);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -17,15 +17,9 @@ import org.openmetadata.service.search.models.FlattenColumn;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class ContainerIndex implements ColumnIndex {
|
public record ContainerIndex(Container container) implements ColumnIndex {
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
final Container container;
|
|
||||||
|
|
||||||
public ContainerIndex(Container container) {
|
|
||||||
this.container = container;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(container);
|
Map<String, Object> doc = JsonUtils.getMap(container);
|
||||||
List<SearchSuggest> suggest = new ArrayList<>();
|
List<SearchSuggest> suggest = new ArrayList<>();
|
||||||
|
@ -17,16 +17,10 @@ import org.openmetadata.service.search.models.FlattenColumn;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class DashboardDataModelIndex implements ColumnIndex {
|
public record DashboardDataModelIndex(DashboardDataModel dashboardDataModel)
|
||||||
|
implements ColumnIndex {
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
final DashboardDataModel dashboardDataModel;
|
|
||||||
|
|
||||||
public DashboardDataModelIndex(DashboardDataModel dashboardDataModel) {
|
|
||||||
this.dashboardDataModel = dashboardDataModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(dashboardDataModel);
|
Map<String, Object> doc = JsonUtils.getMap(dashboardDataModel);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,10 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class DashboardServiceIndex implements SearchIndex {
|
public record DashboardServiceIndex(DashboardService dashboardService) implements SearchIndex {
|
||||||
|
|
||||||
final DashboardService dashboardService;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public DashboardServiceIndex(DashboardService dashboardService) {
|
|
||||||
this.dashboardService = dashboardService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(dashboardService);
|
Map<String, Object> doc = JsonUtils.getMap(dashboardService);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class DataProductIndex implements SearchIndex {
|
public record DataProductIndex(DataProduct dataProduct) implements SearchIndex {
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
final DataProduct dataProduct;
|
|
||||||
|
|
||||||
public DataProductIndex(DataProduct dataProduct) {
|
|
||||||
this.dataProduct = dataProduct;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(dataProduct);
|
Map<String, Object> doc = JsonUtils.getMap(dataProduct);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class DatabaseIndex implements SearchIndex {
|
public record DatabaseIndex(Database database) implements SearchIndex {
|
||||||
|
|
||||||
final Database database;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public DatabaseIndex(Database database) {
|
|
||||||
this.database = database;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(database);
|
Map<String, Object> doc = JsonUtils.getMap(database);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,15 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class DatabaseSchemaIndex implements SearchIndex {
|
public record DatabaseSchemaIndex(DatabaseSchema databaseSchema) implements SearchIndex {
|
||||||
final DatabaseSchema databaseSchema;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public DatabaseSchemaIndex(DatabaseSchema databaseSchema) {
|
|
||||||
this.databaseSchema = databaseSchema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(databaseSchema);
|
Map<String, Object> doc = JsonUtils.getMap(databaseSchema);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class DatabaseServiceIndex implements SearchIndex {
|
public record DatabaseServiceIndex(DatabaseService databaseService) implements SearchIndex {
|
||||||
|
|
||||||
final DatabaseService databaseService;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public DatabaseServiceIndex(DatabaseService databaseService) {
|
|
||||||
this.databaseService = databaseService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(databaseService);
|
Map<String, Object> doc = JsonUtils.getMap(databaseService);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class DomainIndex implements SearchIndex {
|
public record DomainIndex(Domain domain) implements SearchIndex {
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
final Domain domain;
|
|
||||||
|
|
||||||
public DomainIndex(Domain domain) {
|
|
||||||
this.domain = domain;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(domain);
|
Map<String, Object> doc = JsonUtils.getMap(domain);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -4,12 +4,7 @@ import java.util.Map;
|
|||||||
import org.openmetadata.schema.analytics.ReportData;
|
import org.openmetadata.schema.analytics.ReportData;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class EntityReportDataIndex implements SearchIndex {
|
public record EntityReportDataIndex(ReportData reportData) implements SearchIndex {
|
||||||
private final ReportData reportData;
|
|
||||||
|
|
||||||
public EntityReportDataIndex(ReportData reportData) {
|
|
||||||
this.reportData = reportData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class MessagingServiceIndex implements SearchIndex {
|
public record MessagingServiceIndex(MessagingService messagingService) implements SearchIndex {
|
||||||
|
|
||||||
final MessagingService messagingService;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public MessagingServiceIndex(MessagingService messagingService) {
|
|
||||||
this.messagingService = messagingService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(messagingService);
|
Map<String, Object> doc = JsonUtils.getMap(messagingService);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class MetadataServiceIndex implements SearchIndex {
|
public record MetadataServiceIndex(MetadataService metadataService) implements SearchIndex {
|
||||||
|
|
||||||
final MetadataService metadataService;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public MetadataServiceIndex(MetadataService metadataService) {
|
|
||||||
this.metadataService = metadataService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(metadataService);
|
Map<String, Object> doc = JsonUtils.getMap(metadataService);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class MlModelServiceIndex implements SearchIndex {
|
public record MlModelServiceIndex(MlModelService mlModelService) implements SearchIndex {
|
||||||
|
|
||||||
final MlModelService mlModelService;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public MlModelServiceIndex(MlModelService mlModelService) {
|
|
||||||
this.mlModelService = mlModelService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(mlModelService);
|
Map<String, Object> doc = JsonUtils.getMap(mlModelService);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class PipelineServiceIndex implements SearchIndex {
|
public record PipelineServiceIndex(PipelineService pipelineService) implements SearchIndex {
|
||||||
|
|
||||||
final PipelineService pipelineService;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public PipelineServiceIndex(PipelineService pipelineService) {
|
|
||||||
this.pipelineService = pipelineService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(pipelineService);
|
Map<String, Object> doc = JsonUtils.getMap(pipelineService);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -4,13 +4,7 @@ import java.util.Map;
|
|||||||
import org.openmetadata.schema.analytics.ReportData;
|
import org.openmetadata.schema.analytics.ReportData;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class RawCostAnalysisReportDataIndex implements SearchIndex {
|
public record RawCostAnalysisReportDataIndex(ReportData reportData) implements SearchIndex {
|
||||||
private final ReportData reportData;
|
|
||||||
|
|
||||||
public RawCostAnalysisReportDataIndex(ReportData reportData) {
|
|
||||||
this.reportData = reportData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(reportData);
|
Map<String, Object> doc = JsonUtils.getMap(reportData);
|
||||||
|
@ -4,14 +4,7 @@ import java.util.Map;
|
|||||||
import org.openmetadata.schema.analytics.ReportData;
|
import org.openmetadata.schema.analytics.ReportData;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class ReportDataIndexes implements SearchIndex {
|
public record ReportDataIndexes(ReportData reportData) implements SearchIndex {
|
||||||
|
|
||||||
final ReportData reportData;
|
|
||||||
|
|
||||||
public ReportDataIndexes(ReportData reportData) {
|
|
||||||
this.reportData = reportData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(reportData);
|
Map<String, Object> doc = JsonUtils.getMap(reportData);
|
||||||
|
@ -10,16 +10,10 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class SearchEntityIndex implements SearchIndex {
|
public record SearchEntityIndex(org.openmetadata.schema.entity.data.SearchIndex searchIndex)
|
||||||
|
implements SearchIndex {
|
||||||
final org.openmetadata.schema.entity.data.SearchIndex searchIndex;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public SearchEntityIndex(org.openmetadata.schema.entity.data.SearchIndex searchIndex) {
|
|
||||||
this.searchIndex = searchIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(searchIndex);
|
Map<String, Object> doc = JsonUtils.getMap(searchIndex);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class SearchServiceIndex implements SearchIndex {
|
public record SearchServiceIndex(SearchService searchService) implements SearchIndex {
|
||||||
|
|
||||||
final SearchService searchService;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public SearchServiceIndex(SearchService searchService) {
|
|
||||||
this.searchService = searchService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(searchService);
|
Map<String, Object> doc = JsonUtils.getMap(searchService);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class StorageServiceIndex implements SearchIndex {
|
public record StorageServiceIndex(StorageService storageService) implements SearchIndex {
|
||||||
|
|
||||||
final StorageService storageService;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public StorageServiceIndex(StorageService storageService) {
|
|
||||||
this.storageService = storageService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(storageService);
|
Map<String, Object> doc = JsonUtils.getMap(storageService);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -11,16 +11,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class StoredProcedureIndex implements SearchIndex {
|
public record StoredProcedureIndex(StoredProcedure storedProcedure) implements SearchIndex {
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
final StoredProcedure storedProcedure;
|
|
||||||
|
|
||||||
public StoredProcedureIndex(StoredProcedure storedProcedure) {
|
|
||||||
this.storedProcedure = storedProcedure;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(storedProcedure);
|
Map<String, Object> doc = JsonUtils.getMap(storedProcedure);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -18,7 +18,7 @@ import org.openmetadata.service.search.models.FlattenColumn;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class TableIndex implements ColumnIndex {
|
public record TableIndex(Table table) implements ColumnIndex {
|
||||||
private static final List<String> excludeFields =
|
private static final List<String> excludeFields =
|
||||||
List.of(
|
List.of(
|
||||||
"sampleData",
|
"sampleData",
|
||||||
@ -27,12 +27,6 @@ public class TableIndex implements ColumnIndex {
|
|||||||
"changeDescription",
|
"changeDescription",
|
||||||
"viewDefinition, tableProfilerConfig, profile, location, tableQueries, tests, dataModel");
|
"viewDefinition, tableProfilerConfig, profile, location, tableQueries, tests, dataModel");
|
||||||
|
|
||||||
final Table table;
|
|
||||||
|
|
||||||
public TableIndex(Table table) {
|
|
||||||
this.table = table;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(table);
|
Map<String, Object> doc = JsonUtils.getMap(table);
|
||||||
List<SearchSuggest> suggest = new ArrayList<>();
|
List<SearchSuggest> suggest = new ArrayList<>();
|
||||||
|
@ -10,14 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class TagIndex implements SearchIndex {
|
public record TagIndex(Tag tag) implements SearchIndex {
|
||||||
final Tag tag;
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public TagIndex(Tag tag) {
|
|
||||||
this.tag = tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(tag);
|
Map<String, Object> doc = JsonUtils.getMap(tag);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -15,15 +15,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class TestCaseIndex implements SearchIndex {
|
public record TestCaseIndex(TestCase testCase) implements SearchIndex {
|
||||||
final TestCase testCase;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public TestCaseIndex(TestCase testCase) {
|
|
||||||
this.testCase = testCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
List<TestSuite> testSuiteArray = new ArrayList<>();
|
List<TestSuite> testSuiteArray = new ArrayList<>();
|
||||||
|
@ -5,14 +5,8 @@ import java.util.Map;
|
|||||||
import org.openmetadata.schema.tests.type.TestCaseResolutionStatus;
|
import org.openmetadata.schema.tests.type.TestCaseResolutionStatus;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class TestCaseResolutionStatusIndex implements SearchIndex {
|
public record TestCaseResolutionStatusIndex(TestCaseResolutionStatus testCaseResolutionStatus)
|
||||||
|
implements SearchIndex {
|
||||||
final TestCaseResolutionStatus testCaseResolutionStatus;
|
|
||||||
|
|
||||||
public TestCaseResolutionStatusIndex(TestCaseResolutionStatus testCaseResolutionStatus) {
|
|
||||||
this.testCaseResolutionStatus = testCaseResolutionStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
return JsonUtils.getMap(testCaseResolutionStatus);
|
return JsonUtils.getMap(testCaseResolutionStatus);
|
||||||
|
@ -10,15 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
|
|||||||
import org.openmetadata.service.search.models.SearchSuggest;
|
import org.openmetadata.service.search.models.SearchSuggest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class TestSuiteIndex implements SearchIndex {
|
public record TestSuiteIndex(TestSuite testSuite) implements SearchIndex {
|
||||||
final TestSuite testSuite;
|
|
||||||
|
|
||||||
private static final List<String> excludeFields = List.of("changeDescription");
|
private static final List<String> excludeFields = List.of("changeDescription");
|
||||||
|
|
||||||
public TestSuiteIndex(TestSuite testSuite) {
|
|
||||||
this.testSuite = testSuite;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(testSuite);
|
Map<String, Object> doc = JsonUtils.getMap(testSuite);
|
||||||
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
|
||||||
|
@ -4,13 +4,7 @@ import java.util.Map;
|
|||||||
import org.openmetadata.schema.analytics.ReportData;
|
import org.openmetadata.schema.analytics.ReportData;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class WebAnalyticEntityViewReportDataIndex implements SearchIndex {
|
public record WebAnalyticEntityViewReportDataIndex(ReportData reportData) implements SearchIndex {
|
||||||
private final ReportData reportData;
|
|
||||||
|
|
||||||
public WebAnalyticEntityViewReportDataIndex(ReportData reportData) {
|
|
||||||
this.reportData = reportData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(reportData);
|
Map<String, Object> doc = JsonUtils.getMap(reportData);
|
||||||
|
@ -4,13 +4,7 @@ import java.util.Map;
|
|||||||
import org.openmetadata.schema.analytics.ReportData;
|
import org.openmetadata.schema.analytics.ReportData;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
|
|
||||||
public class WebAnalyticUserActivityReportDataIndex implements SearchIndex {
|
public record WebAnalyticUserActivityReportDataIndex(ReportData reportData) implements SearchIndex {
|
||||||
private final ReportData reportData;
|
|
||||||
|
|
||||||
public WebAnalyticUserActivityReportDataIndex(ReportData reportData) {
|
|
||||||
this.reportData = reportData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> buildESDoc() {
|
public Map<String, Object> buildESDoc() {
|
||||||
Map<String, Object> doc = JsonUtils.getMap(reportData);
|
Map<String, Object> doc = JsonUtils.getMap(reportData);
|
||||||
|
@ -1324,8 +1324,6 @@ public class OpenSearchClient implements SearchClient {
|
|||||||
aggregations.getAggregations());
|
aggregations.getAggregations());
|
||||||
case AGGREGATED_USED_VS_UNUSED_ASSETS_SIZE -> new OpenSearchAggregatedUsedvsUnusedAssetsSizeAggregator(
|
case AGGREGATED_USED_VS_UNUSED_ASSETS_SIZE -> new OpenSearchAggregatedUsedvsUnusedAssetsSizeAggregator(
|
||||||
aggregations.getAggregations());
|
aggregations.getAggregations());
|
||||||
default -> throw new IllegalArgumentException(
|
|
||||||
String.format("No processor found for chart Type %s ", dataInsightChartType));
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,11 +16,10 @@ package org.openmetadata.service.security;
|
|||||||
import java.security.Principal;
|
import java.security.Principal;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
public class CatalogPrincipal implements Principal {
|
public record CatalogPrincipal(@Getter String name) implements Principal {
|
||||||
@Getter private final String name;
|
@Override
|
||||||
|
public String getName() {
|
||||||
public CatalogPrincipal(String name) {
|
return name;
|
||||||
this.name = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -9,14 +9,7 @@ import org.openmetadata.schema.type.TagLabel;
|
|||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
|
|
||||||
/** Posts that are part of conversation threads require special handling */
|
/** Posts that are part of conversation threads require special handling */
|
||||||
public class PostResourceContext implements ResourceContextInterface {
|
public record PostResourceContext(String postedBy) implements ResourceContextInterface {
|
||||||
// The user who posted to thread is the owner of that post
|
|
||||||
private final String postedBy;
|
|
||||||
|
|
||||||
public PostResourceContext(String postedBy) {
|
|
||||||
this.postedBy = postedBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getResource() {
|
public String getResource() {
|
||||||
return Entity.THREAD;
|
return Entity.THREAD;
|
||||||
|
@ -8,14 +8,7 @@ import org.openmetadata.schema.type.TagLabel;
|
|||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
|
|
||||||
/** Conversation threads require special handling */
|
/** Conversation threads require special handling */
|
||||||
public class ThreadResourceContext implements ResourceContextInterface {
|
public record ThreadResourceContext(String createdBy) implements ResourceContextInterface {
|
||||||
// User who created the thread is the owner of thread entity
|
|
||||||
private final String createdBy;
|
|
||||||
|
|
||||||
public ThreadResourceContext(String createdBy) {
|
|
||||||
this.createdBy = createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getResource() {
|
public String getResource() {
|
||||||
return Entity.THREAD;
|
return Entity.THREAD;
|
||||||
|
@ -3,16 +3,15 @@ package org.openmetadata.service.util;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AsciiTable {
|
public record AsciiTable(
|
||||||
|
List<String> columns,
|
||||||
|
List<List<String>> rows,
|
||||||
|
boolean printHeader,
|
||||||
|
String nullText,
|
||||||
|
String emptyText) {
|
||||||
private static final String DEFAULT_COLUMN_NAME = "(No column name)";
|
private static final String DEFAULT_COLUMN_NAME = "(No column name)";
|
||||||
private static final String DEFAULT_NO_VALUE = "-";
|
private static final String DEFAULT_NO_VALUE = "-";
|
||||||
|
|
||||||
private final List<String> columns;
|
|
||||||
private final List<List<String>> rows;
|
|
||||||
private final boolean printHeader;
|
|
||||||
private final String nullText;
|
|
||||||
private final String emptyText;
|
|
||||||
|
|
||||||
public AsciiTable(
|
public AsciiTable(
|
||||||
List<String> columns,
|
List<String> columns,
|
||||||
List<List<String>> rows,
|
List<List<String>> rows,
|
||||||
@ -35,7 +34,7 @@ public class AsciiTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The table rendered with column header and row data.
|
* Return table rendered with column header and row data.
|
||||||
*/
|
*/
|
||||||
public String render() {
|
public String render() {
|
||||||
List<Integer> widths = new ArrayList<>();
|
List<Integer> widths = new ArrayList<>();
|
||||||
|
@ -185,8 +185,6 @@ public class OpenMetadataConnectionBuilder {
|
|||||||
return switch (verifySSL) {
|
return switch (verifySSL) {
|
||||||
case NO_SSL, IGNORE -> null;
|
case NO_SSL, IGNORE -> null;
|
||||||
case VALIDATE -> JsonUtils.convertValue(sslConfig, ValidateSSLClientConfig.class);
|
case VALIDATE -> JsonUtils.convertValue(sslConfig, ValidateSSLClientConfig.class);
|
||||||
default -> throw new IllegalArgumentException(
|
|
||||||
"OpenMetadata doesn't support SSL verification type " + verifySSL.value());
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,6 @@ class DatabaseSchemaResourceTest extends EntityResourceTest<DatabaseSchema, Crea
|
|||||||
result = importCsv(schemaName, csv, false);
|
result = importCsv(schemaName, csv, false);
|
||||||
assertSummary(result, ApiStatus.FAILURE, 2, 1, 1);
|
assertSummary(result, ApiStatus.FAILURE, 2, 1, 1);
|
||||||
String tableFqn = FullyQualifiedName.add(schema.getFullyQualifiedName(), "non-existing");
|
String tableFqn = FullyQualifiedName.add(schema.getFullyQualifiedName(), "non-existing");
|
||||||
tableFqn.replace("\"", "\"\""); // To handle double quote CSV escaping
|
|
||||||
expectedRows =
|
expectedRows =
|
||||||
new String[] {
|
new String[] {
|
||||||
resultsHeader, getFailedRecord(record, entityNotFound(0, Entity.TABLE, tableFqn))
|
resultsHeader, getFailedRecord(record, entityNotFound(0, Entity.TABLE, tableFqn))
|
||||||
|
@ -164,7 +164,7 @@ public class DataProductResourceTest extends EntityResourceTest<DataProduct, Cre
|
|||||||
EntityInterface entity, EntityInterface product, boolean inDataProduct)
|
EntityInterface entity, EntityInterface product, boolean inDataProduct)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
// Only table or topic is expected to assets currently in the tests
|
// Only table or topic is expected to assets currently in the tests
|
||||||
EntityResourceTest test =
|
EntityResourceTest<?, ?> test =
|
||||||
entity.getEntityReference().getType().equals(Entity.TABLE)
|
entity.getEntityReference().getType().equals(Entity.TABLE)
|
||||||
? new TableResourceTest()
|
? new TableResourceTest()
|
||||||
: new TopicResourceTest();
|
: new TopicResourceTest();
|
||||||
|
@ -897,7 +897,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
storedTestSuite.getTestCaseResultSummary().stream()
|
storedTestSuite.getTestCaseResultSummary().stream()
|
||||||
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
|
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.get();
|
.orElse(null);
|
||||||
assertEquals(
|
assertEquals(
|
||||||
TestUtils.dateToTimestamp("2023-08-15"), storedTestCase.getTestCaseResult().getTimestamp());
|
TestUtils.dateToTimestamp("2023-08-15"), storedTestCase.getTestCaseResult().getTimestamp());
|
||||||
assertEquals(1, storedTestSuite.getSummary().getTotal());
|
assertEquals(1, storedTestSuite.getSummary().getTotal());
|
||||||
@ -914,7 +914,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
storedTestSuite.getTestCaseResultSummary().stream()
|
storedTestSuite.getTestCaseResultSummary().stream()
|
||||||
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
|
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.get();
|
.orElse(null);
|
||||||
assertEquals(
|
assertEquals(
|
||||||
TestUtils.dateToTimestamp("2023-08-14"), storedTestCase.getTestCaseResult().getTimestamp());
|
TestUtils.dateToTimestamp("2023-08-14"), storedTestCase.getTestCaseResult().getTimestamp());
|
||||||
assertEquals(1, storedTestSuite.getSummary().getTotal());
|
assertEquals(1, storedTestSuite.getSummary().getTotal());
|
||||||
@ -930,7 +930,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
storedTestSuite.getTestCaseResultSummary().stream()
|
storedTestSuite.getTestCaseResultSummary().stream()
|
||||||
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
|
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.get();
|
.orElse(null);
|
||||||
storedTestCase = getEntity(testCase.getId(), "testCaseResult", ADMIN_AUTH_HEADERS);
|
storedTestCase = getEntity(testCase.getId(), "testCaseResult", ADMIN_AUTH_HEADERS);
|
||||||
assertEquals(
|
assertEquals(
|
||||||
TestUtils.dateToTimestamp("2023-08-14"), storedTestCase.getTestCaseResult().getTimestamp());
|
TestUtils.dateToTimestamp("2023-08-14"), storedTestCase.getTestCaseResult().getTimestamp());
|
||||||
@ -957,7 +957,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
storedTestSuite.getTestCaseResultSummary().stream()
|
storedTestSuite.getTestCaseResultSummary().stream()
|
||||||
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
|
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.get();
|
.orElse(null);
|
||||||
assertEquals(
|
assertEquals(
|
||||||
TestUtils.dateToTimestamp("2023-08-16"), storedTestCase.getTestCaseResult().getTimestamp());
|
TestUtils.dateToTimestamp("2023-08-16"), storedTestCase.getTestCaseResult().getTimestamp());
|
||||||
assertEquals(1, storedTestSuite.getSummary().getTotal());
|
assertEquals(1, storedTestSuite.getSummary().getTotal());
|
||||||
|
@ -998,7 +998,6 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
|
|||||||
|
|
||||||
// Contains Marathi characters
|
// Contains Marathi characters
|
||||||
translations.add("नमस्कार जग");
|
translations.add("नमस्कार जग");
|
||||||
translations.add("नमस्कार");
|
|
||||||
|
|
||||||
// Contains Bengali characters
|
// Contains Bengali characters
|
||||||
translations.add("ওহে বিশ্ব");
|
translations.add("ওহে বিশ্ব");
|
||||||
@ -1026,7 +1025,6 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
|
|||||||
|
|
||||||
// Contains Nepali characters
|
// Contains Nepali characters
|
||||||
translations.add("नमस्कार संसार");
|
translations.add("नमस्कार संसार");
|
||||||
translations.add("नमस्कार");
|
|
||||||
|
|
||||||
// Contains Urdu characters
|
// Contains Urdu characters
|
||||||
translations.add("ہیلو دنیا");
|
translations.add("ہیلو دنیا");
|
||||||
|
@ -567,8 +567,7 @@ public class ContainerResourceTest extends EntityResourceTest<Container, CreateC
|
|||||||
|
|
||||||
Column c2_f = getColumn("f", CHAR, USER_ADDRESS_TAG_LABEL);
|
Column c2_f = getColumn("f", CHAR, USER_ADDRESS_TAG_LABEL);
|
||||||
c2.getChildren().add(c2_f); // Add c2.f
|
c2.getChildren().add(c2_f); // Add c2.f
|
||||||
create2 =
|
create2.withDataModel(new ContainerDataModel().withColumns(Arrays.asList(c1_new, c2)));
|
||||||
create2.withDataModel(new ContainerDataModel().withColumns(Arrays.asList(c1_new, c2)));
|
|
||||||
fieldAdded(change, build("dataModel.columns", C2), List.of(c2_f));
|
fieldAdded(change, build("dataModel.columns", C2), List.of(c2_f));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -41,7 +41,7 @@ class RuleEvaluatorTest {
|
|||||||
private static User user;
|
private static User user;
|
||||||
private static EvaluationContext evaluationContext;
|
private static EvaluationContext evaluationContext;
|
||||||
private static SubjectContext subjectContext;
|
private static SubjectContext subjectContext;
|
||||||
private static ResourceContext resourceContext;
|
private static ResourceContext<?> resourceContext;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setup() {
|
public static void setup() {
|
||||||
@ -87,7 +87,7 @@ class RuleEvaluatorTest {
|
|||||||
.thenAnswer((Answer<List<TagLabel>>) invocationOnMock -> table.getTags());
|
.thenAnswer((Answer<List<TagLabel>>) invocationOnMock -> table.getTags());
|
||||||
|
|
||||||
user = new User().withId(UUID.randomUUID()).withName("user");
|
user = new User().withId(UUID.randomUUID()).withName("user");
|
||||||
resourceContext = new ResourceContext("table", table, mock(TableRepository.class));
|
resourceContext = new ResourceContext<>("table", table, mock(TableRepository.class));
|
||||||
subjectContext = new SubjectContext(user);
|
subjectContext = new SubjectContext(user);
|
||||||
RuleEvaluator ruleEvaluator = new RuleEvaluator(null, subjectContext, resourceContext);
|
RuleEvaluator ruleEvaluator = new RuleEvaluator(null, subjectContext, resourceContext);
|
||||||
evaluationContext =
|
evaluationContext =
|
||||||
|
@ -123,7 +123,7 @@ class JsonUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testJsonWithFieldsRemoveFields() throws URISyntaxException {
|
void testJsonWithFieldsRemoveFields() throws URISyntaxException {
|
||||||
HashMap authType = new HashMap();
|
HashMap<String, String> authType = new HashMap<>();
|
||||||
authType.put("username", "username");
|
authType.put("username", "username");
|
||||||
authType.put("password", "password");
|
authType.put("password", "password");
|
||||||
TableauConnection airflowConnection =
|
TableauConnection airflowConnection =
|
||||||
|
3
pom.xml
3
pom.xml
@ -299,13 +299,11 @@
|
|||||||
<groupId>org.opensearch.client</groupId>
|
<groupId>org.opensearch.client</groupId>
|
||||||
<artifactId>opensearch-rest-high-level-client</artifactId>
|
<artifactId>opensearch-rest-high-level-client</artifactId>
|
||||||
<version>${opensearch.version}</version>
|
<version>${opensearch.version}</version>
|
||||||
<!-- <classifier>shaded</classifier>-->
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.elasticsearch.client</groupId>
|
<groupId>org.elasticsearch.client</groupId>
|
||||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||||
<version>${elasticsearch.version}</version>
|
<version>${elasticsearch.version}</version>
|
||||||
<!-- <classifier>shaded</classifier>-->
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
@ -767,6 +765,7 @@
|
|||||||
<artifactId>maven-release-plugin</artifactId>
|
<artifactId>maven-release-plugin</artifactId>
|
||||||
<version>${maven-release-plugin.version}</version>
|
<version>${maven-release-plugin.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<!--suppress UnresolvedMavenProperty -->
|
||||||
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
|
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user