Clean up code issues flagged by IDE (#14585)

This commit is contained in:
Suresh Srinivas 2024-01-05 07:01:08 -08:00 committed by GitHub
parent 85091dc94c
commit 308b4c2096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 57 additions and 265 deletions

View File

@ -3790,7 +3790,6 @@ public interface CollectionDAO {
case PASSWORD_RESET -> JsonUtils.readValue(json, PasswordResetToken.class);
case REFRESH_TOKEN -> JsonUtils.readValue(json, RefreshToken.class);
case PERSONAL_ACCESS_TOKEN -> JsonUtils.readValue(json, PersonalAccessToken.class);
default -> throw new IllegalArgumentException("Invalid Token Type.");
};
}
}

View File

@ -4,7 +4,7 @@ import java.util.List;
public class CommonMigrationOps {
private CommonMigrationOps() {
/** Hidden constructor */
/* Hidden constructor */
}
public static final List<MigrationOps> COMMON_OPS =

View File

@ -668,7 +668,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
UUID id) {
OperationContext operationContext =
new OperationContext(entityType, MetadataOperation.VIEW_SAMPLE_DATA);
ResourceContext resourceContext = getResourceContextById(id);
ResourceContext<?> resourceContext = getResourceContextById(id);
authorizer.authorize(securityContext, operationContext, resourceContext);
boolean authorizePII = authorizer.authorizePII(securityContext, resourceContext.getOwner());
@ -809,7 +809,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
String fqn) {
OperationContext operationContext =
new OperationContext(entityType, MetadataOperation.VIEW_DATA_PROFILE);
ResourceContext resourceContext = getResourceContextByName(fqn);
ResourceContext<?> resourceContext = getResourceContextByName(fqn);
authorizer.authorize(securityContext, operationContext, resourceContext);
boolean authorizePII = authorizer.authorizePII(securityContext, resourceContext.getOwner());

View File

@ -1319,8 +1319,6 @@ public class ElasticSearchClient implements SearchClient {
aggregations.getAggregations());
case AGGREGATED_USED_VS_UNUSED_ASSETS_SIZE -> new ElasticSearchAggregatedUsedvsUnusedAssetsSizeAggregator(
aggregations.getAggregations());
default -> throw new IllegalArgumentException(
String.format("No processor found for chart Type %s ", dataInsightChartType));
};
}

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
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");
final Chart chart;
public ChartIndex(Chart chart) {
this.chart = chart;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(chart);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
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");
final Classification classification;
public ClassificationIndex(Classification classification) {
this.classification = classification;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(classification);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -17,15 +17,9 @@ import org.openmetadata.service.search.models.FlattenColumn;
import org.openmetadata.service.search.models.SearchSuggest;
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");
final Container container;
public ContainerIndex(Container container) {
this.container = container;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(container);
List<SearchSuggest> suggest = new ArrayList<>();

View File

@ -17,16 +17,10 @@ import org.openmetadata.service.search.models.FlattenColumn;
import org.openmetadata.service.search.models.SearchSuggest;
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");
final DashboardDataModel dashboardDataModel;
public DashboardDataModelIndex(DashboardDataModel dashboardDataModel) {
this.dashboardDataModel = dashboardDataModel;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(dashboardDataModel);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,10 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class DashboardServiceIndex implements SearchIndex {
final DashboardService dashboardService;
public record DashboardServiceIndex(DashboardService dashboardService) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public DashboardServiceIndex(DashboardService dashboardService) {
this.dashboardService = dashboardService;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(dashboardService);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
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");
final DataProduct dataProduct;
public DataProductIndex(DataProduct dataProduct) {
this.dataProduct = dataProduct;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(dataProduct);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class DatabaseIndex implements SearchIndex {
final Database database;
public record DatabaseIndex(Database database) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public DatabaseIndex(Database database) {
this.database = database;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(database);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,15 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class DatabaseSchemaIndex implements SearchIndex {
final DatabaseSchema databaseSchema;
public record DatabaseSchemaIndex(DatabaseSchema databaseSchema) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public DatabaseSchemaIndex(DatabaseSchema databaseSchema) {
this.databaseSchema = databaseSchema;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(databaseSchema);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class DatabaseServiceIndex implements SearchIndex {
final DatabaseService databaseService;
public record DatabaseServiceIndex(DatabaseService databaseService) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public DatabaseServiceIndex(DatabaseService databaseService) {
this.databaseService = databaseService;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(databaseService);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
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");
final Domain domain;
public DomainIndex(Domain domain) {
this.domain = domain;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(domain);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -4,12 +4,7 @@ import java.util.Map;
import org.openmetadata.schema.analytics.ReportData;
import org.openmetadata.service.util.JsonUtils;
public class EntityReportDataIndex implements SearchIndex {
private final ReportData reportData;
public EntityReportDataIndex(ReportData reportData) {
this.reportData = reportData;
}
public record EntityReportDataIndex(ReportData reportData) implements SearchIndex {
@Override
public Map<String, Object> buildESDoc() {

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class MessagingServiceIndex implements SearchIndex {
final MessagingService messagingService;
public record MessagingServiceIndex(MessagingService messagingService) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public MessagingServiceIndex(MessagingService messagingService) {
this.messagingService = messagingService;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(messagingService);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class MetadataServiceIndex implements SearchIndex {
final MetadataService metadataService;
public record MetadataServiceIndex(MetadataService metadataService) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public MetadataServiceIndex(MetadataService metadataService) {
this.metadataService = metadataService;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(metadataService);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class MlModelServiceIndex implements SearchIndex {
final MlModelService mlModelService;
public record MlModelServiceIndex(MlModelService mlModelService) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public MlModelServiceIndex(MlModelService mlModelService) {
this.mlModelService = mlModelService;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(mlModelService);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class PipelineServiceIndex implements SearchIndex {
final PipelineService pipelineService;
public record PipelineServiceIndex(PipelineService pipelineService) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public PipelineServiceIndex(PipelineService pipelineService) {
this.pipelineService = pipelineService;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(pipelineService);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -4,13 +4,7 @@ import java.util.Map;
import org.openmetadata.schema.analytics.ReportData;
import org.openmetadata.service.util.JsonUtils;
public class RawCostAnalysisReportDataIndex implements SearchIndex {
private final ReportData reportData;
public RawCostAnalysisReportDataIndex(ReportData reportData) {
this.reportData = reportData;
}
public record RawCostAnalysisReportDataIndex(ReportData reportData) implements SearchIndex {
@Override
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(reportData);

View File

@ -4,14 +4,7 @@ import java.util.Map;
import org.openmetadata.schema.analytics.ReportData;
import org.openmetadata.service.util.JsonUtils;
public class ReportDataIndexes implements SearchIndex {
final ReportData reportData;
public ReportDataIndexes(ReportData reportData) {
this.reportData = reportData;
}
public record ReportDataIndexes(ReportData reportData) implements SearchIndex {
@Override
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(reportData);

View File

@ -10,16 +10,10 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class SearchEntityIndex implements SearchIndex {
final org.openmetadata.schema.entity.data.SearchIndex searchIndex;
public record SearchEntityIndex(org.openmetadata.schema.entity.data.SearchIndex searchIndex)
implements SearchIndex {
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() {
Map<String, Object> doc = JsonUtils.getMap(searchIndex);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class SearchServiceIndex implements SearchIndex {
final SearchService searchService;
public record SearchServiceIndex(SearchService searchService) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public SearchServiceIndex(SearchService searchService) {
this.searchService = searchService;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(searchService);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -10,16 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class StorageServiceIndex implements SearchIndex {
final StorageService storageService;
public record StorageServiceIndex(StorageService storageService) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public StorageServiceIndex(StorageService storageService) {
this.storageService = storageService;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(storageService);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -11,16 +11,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
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");
final StoredProcedure storedProcedure;
public StoredProcedureIndex(StoredProcedure storedProcedure) {
this.storedProcedure = storedProcedure;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(storedProcedure);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -18,7 +18,7 @@ import org.openmetadata.service.search.models.FlattenColumn;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class TableIndex implements ColumnIndex {
public record TableIndex(Table table) implements ColumnIndex {
private static final List<String> excludeFields =
List.of(
"sampleData",
@ -27,12 +27,6 @@ public class TableIndex implements ColumnIndex {
"changeDescription",
"viewDefinition, tableProfilerConfig, profile, location, tableQueries, tests, dataModel");
final Table table;
public TableIndex(Table table) {
this.table = table;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(table);
List<SearchSuggest> suggest = new ArrayList<>();

View File

@ -10,14 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class TagIndex implements SearchIndex {
final Tag tag;
public record TagIndex(Tag tag) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public TagIndex(Tag tag) {
this.tag = tag;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(tag);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -15,15 +15,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class TestCaseIndex implements SearchIndex {
final TestCase testCase;
public record TestCaseIndex(TestCase testCase) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public TestCaseIndex(TestCase testCase) {
this.testCase = testCase;
}
@SneakyThrows
public Map<String, Object> buildESDoc() {
List<TestSuite> testSuiteArray = new ArrayList<>();

View File

@ -5,14 +5,8 @@ import java.util.Map;
import org.openmetadata.schema.tests.type.TestCaseResolutionStatus;
import org.openmetadata.service.util.JsonUtils;
public class TestCaseResolutionStatusIndex implements SearchIndex {
final TestCaseResolutionStatus testCaseResolutionStatus;
public TestCaseResolutionStatusIndex(TestCaseResolutionStatus testCaseResolutionStatus) {
this.testCaseResolutionStatus = testCaseResolutionStatus;
}
public record TestCaseResolutionStatusIndex(TestCaseResolutionStatus testCaseResolutionStatus)
implements SearchIndex {
@Override
public Map<String, Object> buildESDoc() {
return JsonUtils.getMap(testCaseResolutionStatus);

View File

@ -10,15 +10,9 @@ import org.openmetadata.service.search.SearchIndexUtils;
import org.openmetadata.service.search.models.SearchSuggest;
import org.openmetadata.service.util.JsonUtils;
public class TestSuiteIndex implements SearchIndex {
final TestSuite testSuite;
public record TestSuiteIndex(TestSuite testSuite) implements SearchIndex {
private static final List<String> excludeFields = List.of("changeDescription");
public TestSuiteIndex(TestSuite testSuite) {
this.testSuite = testSuite;
}
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(testSuite);
SearchIndexUtils.removeNonIndexableFields(doc, excludeFields);

View File

@ -4,13 +4,7 @@ import java.util.Map;
import org.openmetadata.schema.analytics.ReportData;
import org.openmetadata.service.util.JsonUtils;
public class WebAnalyticEntityViewReportDataIndex implements SearchIndex {
private final ReportData reportData;
public WebAnalyticEntityViewReportDataIndex(ReportData reportData) {
this.reportData = reportData;
}
public record WebAnalyticEntityViewReportDataIndex(ReportData reportData) implements SearchIndex {
@Override
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(reportData);

View File

@ -4,13 +4,7 @@ import java.util.Map;
import org.openmetadata.schema.analytics.ReportData;
import org.openmetadata.service.util.JsonUtils;
public class WebAnalyticUserActivityReportDataIndex implements SearchIndex {
private final ReportData reportData;
public WebAnalyticUserActivityReportDataIndex(ReportData reportData) {
this.reportData = reportData;
}
public record WebAnalyticUserActivityReportDataIndex(ReportData reportData) implements SearchIndex {
@Override
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(reportData);

View File

@ -1324,8 +1324,6 @@ public class OpenSearchClient implements SearchClient {
aggregations.getAggregations());
case AGGREGATED_USED_VS_UNUSED_ASSETS_SIZE -> new OpenSearchAggregatedUsedvsUnusedAssetsSizeAggregator(
aggregations.getAggregations());
default -> throw new IllegalArgumentException(
String.format("No processor found for chart Type %s ", dataInsightChartType));
};
}

View File

@ -16,11 +16,10 @@ package org.openmetadata.service.security;
import java.security.Principal;
import lombok.Getter;
public class CatalogPrincipal implements Principal {
@Getter private final String name;
public CatalogPrincipal(String name) {
this.name = name;
public record CatalogPrincipal(@Getter String name) implements Principal {
@Override
public String getName() {
return name;
}
@Override

View File

@ -9,14 +9,7 @@ import org.openmetadata.schema.type.TagLabel;
import org.openmetadata.service.Entity;
/** Posts that are part of conversation threads require special handling */
public class PostResourceContext 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;
}
public record PostResourceContext(String postedBy) implements ResourceContextInterface {
@Override
public String getResource() {
return Entity.THREAD;

View File

@ -8,14 +8,7 @@ import org.openmetadata.schema.type.TagLabel;
import org.openmetadata.service.Entity;
/** Conversation threads require special handling */
public class ThreadResourceContext implements ResourceContextInterface {
// User who created the thread is the owner of thread entity
private final String createdBy;
public ThreadResourceContext(String createdBy) {
this.createdBy = createdBy;
}
public record ThreadResourceContext(String createdBy) implements ResourceContextInterface {
@Override
public String getResource() {
return Entity.THREAD;

View File

@ -3,16 +3,15 @@ package org.openmetadata.service.util;
import java.util.ArrayList;
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_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(
List<String> columns,
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() {
List<Integer> widths = new ArrayList<>();

View File

@ -185,8 +185,6 @@ public class OpenMetadataConnectionBuilder {
return switch (verifySSL) {
case NO_SSL, IGNORE -> null;
case VALIDATE -> JsonUtils.convertValue(sslConfig, ValidateSSLClientConfig.class);
default -> throw new IllegalArgumentException(
"OpenMetadata doesn't support SSL verification type " + verifySSL.value());
};
}
}

View File

@ -134,7 +134,6 @@ class DatabaseSchemaResourceTest extends EntityResourceTest<DatabaseSchema, Crea
result = importCsv(schemaName, csv, false);
assertSummary(result, ApiStatus.FAILURE, 2, 1, 1);
String tableFqn = FullyQualifiedName.add(schema.getFullyQualifiedName(), "non-existing");
tableFqn.replace("\"", "\"\""); // To handle double quote CSV escaping
expectedRows =
new String[] {
resultsHeader, getFailedRecord(record, entityNotFound(0, Entity.TABLE, tableFqn))

View File

@ -164,7 +164,7 @@ public class DataProductResourceTest extends EntityResourceTest<DataProduct, Cre
EntityInterface entity, EntityInterface product, boolean inDataProduct)
throws HttpResponseException {
// Only table or topic is expected to assets currently in the tests
EntityResourceTest test =
EntityResourceTest<?, ?> test =
entity.getEntityReference().getType().equals(Entity.TABLE)
? new TableResourceTest()
: new TopicResourceTest();

View File

@ -897,7 +897,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
storedTestSuite.getTestCaseResultSummary().stream()
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
.findFirst()
.get();
.orElse(null);
assertEquals(
TestUtils.dateToTimestamp("2023-08-15"), storedTestCase.getTestCaseResult().getTimestamp());
assertEquals(1, storedTestSuite.getSummary().getTotal());
@ -914,7 +914,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
storedTestSuite.getTestCaseResultSummary().stream()
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
.findFirst()
.get();
.orElse(null);
assertEquals(
TestUtils.dateToTimestamp("2023-08-14"), storedTestCase.getTestCaseResult().getTimestamp());
assertEquals(1, storedTestSuite.getSummary().getTotal());
@ -930,7 +930,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
storedTestSuite.getTestCaseResultSummary().stream()
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
.findFirst()
.get();
.orElse(null);
storedTestCase = getEntity(testCase.getId(), "testCaseResult", ADMIN_AUTH_HEADERS);
assertEquals(
TestUtils.dateToTimestamp("2023-08-14"), storedTestCase.getTestCaseResult().getTimestamp());
@ -957,7 +957,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
storedTestSuite.getTestCaseResultSummary().stream()
.filter(t -> t.getTestCaseName().equals(testCase.getFullyQualifiedName()))
.findFirst()
.get();
.orElse(null);
assertEquals(
TestUtils.dateToTimestamp("2023-08-16"), storedTestCase.getTestCaseResult().getTimestamp());
assertEquals(1, storedTestSuite.getSummary().getTotal());

View File

@ -998,7 +998,6 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
// Contains Marathi characters
translations.add("नमस्कार जग");
translations.add("नमस्कार");
// Contains Bengali characters
translations.add("ওহে বিশ্ব");
@ -1026,7 +1025,6 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
// Contains Nepali characters
translations.add("नमस्कार संसार");
translations.add("नमस्कार");
// Contains Urdu characters
translations.add("ہیلو دنیا");

View File

@ -567,8 +567,7 @@ public class ContainerResourceTest extends EntityResourceTest<Container, CreateC
Column c2_f = getColumn("f", CHAR, USER_ADDRESS_TAG_LABEL);
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));
//

View File

@ -41,7 +41,7 @@ class RuleEvaluatorTest {
private static User user;
private static EvaluationContext evaluationContext;
private static SubjectContext subjectContext;
private static ResourceContext resourceContext;
private static ResourceContext<?> resourceContext;
@BeforeAll
public static void setup() {
@ -87,7 +87,7 @@ class RuleEvaluatorTest {
.thenAnswer((Answer<List<TagLabel>>) invocationOnMock -> table.getTags());
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);
RuleEvaluator ruleEvaluator = new RuleEvaluator(null, subjectContext, resourceContext);
evaluationContext =

View File

@ -123,7 +123,7 @@ class JsonUtilsTest {
@Test
void testJsonWithFieldsRemoveFields() throws URISyntaxException {
HashMap authType = new HashMap();
HashMap<String, String> authType = new HashMap<>();
authType.put("username", "username");
authType.put("password", "password");
TableauConnection airflowConnection =

View File

@ -299,13 +299,11 @@
<groupId>org.opensearch.client</groupId>
<artifactId>opensearch-rest-high-level-client</artifactId>
<version>${opensearch.version}</version>
<!-- <classifier>shaded</classifier>-->
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>${elasticsearch.version}</version>
<!-- <classifier>shaded</classifier>-->
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
@ -767,6 +765,7 @@
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
</configuration>
</plugin>