From f8c52d58592c1a6058be6996b7f7bf55bdda9dcd Mon Sep 17 00:00:00 2001 From: David Leifker Date: Thu, 3 Oct 2024 13:32:37 -0500 Subject: [PATCH] test updates --- .../elasticsearch/query/ESSearchDAO.java | 7 +-- .../entity/DeleteEntityServiceTest.java | 4 +- .../extractor/AspectExtractorTest.java | 2 +- .../SearchGraphServiceElasticSearchTest.java | 5 +- .../SearchGraphServiceOpenSearchTest.java | 5 +- .../LineageSearchResultCacheKeyTest.java | 4 +- .../search/LineageServiceTestBase.java | 9 +--- .../search/SearchServiceTestBase.java | 9 +--- .../metadata/search/TestEntityTestBase.java | 9 +--- .../GoldenElasticSearchTest.java | 2 +- .../IndexBuilderElasticSearchTest.java | 2 +- .../LineageDataFixtureElasticSearchTest.java | 5 +- .../LineageServiceElasticSearchTest.java | 11 ++--- .../SampleDataFixtureElasticSearchTest.java | 8 +++- .../SearchDAOElasticSearchTest.java | 2 +- .../SearchServiceElasticSearchTest.java | 11 ++--- ...ystemMetadataServiceElasticSearchTest.java | 5 +- .../TestEntityElasticSearchTest.java | 11 ++--- ...eseriesAspectServiceElasticSearchTest.java | 5 +- .../search/fixtures/GoldenTestBase.java | 1 - .../fixtures/SampleDataFixtureSetupTest.java | 47 ------------------- .../fixtures/SampleDataFixtureTestBase.java | 42 +++++++++++++++-- .../opensearch/GoldenOpenSearchTest.java | 2 +- .../IndexBuilderOpenSearchTest.java | 2 +- .../LineageDataFixtureOpenSearchTest.java | 5 +- .../LineageServiceOpenSearchTest.java | 11 ++--- .../SampleDataFixtureOpenSearchTest.java | 8 +++- .../opensearch/SearchDAOOpenSearchTest.java | 2 +- .../SearchServiceOpenSearchTest.java | 11 ++--- .../SystemMetadataServiceOpenSearchTest.java | 5 +- .../opensearch/TestEntityOpenSearchTest.java | 11 ++--- ...TimeseriesAspectServiceOpenSearchTest.java | 5 +- .../PropertyDefinitionValidatorTest.java | 2 +- ...chemaMetadataChangeEventGeneratorTest.java | 2 +- .../SearchLineageFixtureConfiguration.java | 2 +- 35 files changed, 117 insertions(+), 157 deletions(-) delete mode 100644 metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureSetupTest.java diff --git a/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESSearchDAO.java b/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESSearchDAO.java index 14e8fb2ddaf80a..f09a81c0c8b891 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESSearchDAO.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/search/elasticsearch/query/ESSearchDAO.java @@ -636,16 +636,17 @@ public ExplainResponse explain( } } - private static void testLog(ObjectMapper mapper, SearchRequest searchRequest) { + private void testLog(ObjectMapper mapper, SearchRequest searchRequest) { try { + log.warn("SearchRequest(custom): {}", mapper.writeValueAsString(customSearchConfiguration)); final String[] indices = searchRequest.indices(); log.warn( String.format( - "SearchRequest: %s", + "SearchRequest(indices): %s", mapper.writerWithDefaultPrettyPrinter().writeValueAsString(indices))); log.warn( String.format( - "SearchRequest: %s", + "SearchRequest(query): %s", mapper.writeValueAsString(mapper.readTree(searchRequest.source().toString())))); } catch (JsonProcessingException e) { log.warn("Error writing test log"); diff --git a/metadata-io/src/test/java/com/linkedin/metadata/entity/DeleteEntityServiceTest.java b/metadata-io/src/test/java/com/linkedin/metadata/entity/DeleteEntityServiceTest.java index d585ff1ce8383f..0e8ee08e60739f 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/entity/DeleteEntityServiceTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/entity/DeleteEntityServiceTest.java @@ -2,7 +2,9 @@ import static com.linkedin.metadata.search.utils.QueryUtils.*; import static org.mockito.Mockito.*; -import static org.testng.AssertJUnit.*; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; import com.datahub.util.RecordUtils; import com.google.common.collect.ImmutableList; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/extractor/AspectExtractorTest.java b/metadata-io/src/test/java/com/linkedin/metadata/extractor/AspectExtractorTest.java index a98386f6f871b0..f8bf2376e6bc12 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/extractor/AspectExtractorTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/extractor/AspectExtractorTest.java @@ -1,6 +1,6 @@ package com.linkedin.metadata.extractor; -import static org.testng.AssertJUnit.assertEquals; +import static org.testng.Assert.assertEquals; import com.datahub.test.TestEntityAspect; import com.datahub.test.TestEntityAspectArray; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/graph/search/elasticsearch/SearchGraphServiceElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/graph/search/elasticsearch/SearchGraphServiceElasticSearchTest.java index b2c49857cb0b96..8a0dfcbe34a69e 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/graph/search/elasticsearch/SearchGraphServiceElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/graph/search/elasticsearch/SearchGraphServiceElasticSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.graph.search.elasticsearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.graph.search.SearchGraphServiceTestBase; import com.linkedin.metadata.search.elasticsearch.ElasticSearchSuite; import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder; @@ -9,7 +11,6 @@ import org.opensearch.client.RestHighLevelClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ElasticSearchSuite.class, SearchTestContainerConfiguration.class}) @@ -39,6 +40,6 @@ protected ESIndexBuilder getIndexBuilder() { @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/graph/search/opensearch/SearchGraphServiceOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/graph/search/opensearch/SearchGraphServiceOpenSearchTest.java index 28b545f8175391..08a6ea4ef2c9c7 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/graph/search/opensearch/SearchGraphServiceOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/graph/search/opensearch/SearchGraphServiceOpenSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.graph.search.opensearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.graph.search.SearchGraphServiceTestBase; import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder; import com.linkedin.metadata.search.elasticsearch.update.ESBulkProcessor; @@ -9,7 +11,6 @@ import org.opensearch.client.RestHighLevelClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({OpenSearchSuite.class, SearchTestContainerConfiguration.class}) @@ -39,6 +40,6 @@ protected ESIndexBuilder getIndexBuilder() { @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/LineageSearchResultCacheKeyTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/LineageSearchResultCacheKeyTest.java index 1d4a545fc06a2b..d2d27bc2de27c5 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/LineageSearchResultCacheKeyTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/LineageSearchResultCacheKeyTest.java @@ -1,7 +1,7 @@ package com.linkedin.metadata.search; -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNotSame; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotSame; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/LineageServiceTestBase.java b/metadata-io/src/test/java/com/linkedin/metadata/search/LineageServiceTestBase.java index d9268c1b50efeb..39fb6001eeb952 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/LineageServiceTestBase.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/LineageServiceTestBase.java @@ -35,7 +35,6 @@ import com.linkedin.metadata.config.cache.SearchCacheConfiguration; import com.linkedin.metadata.config.cache.SearchLineageCacheConfiguration; import com.linkedin.metadata.config.search.SearchConfiguration; -import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.graph.EntityLineageResult; import com.linkedin.metadata.graph.GraphService; import com.linkedin.metadata.graph.LineageDirection; @@ -103,9 +102,6 @@ public abstract class LineageServiceTestBase extends AbstractTestNGSpringContext @Nonnull protected abstract SearchConfiguration getSearchConfiguration(); - @Nonnull - protected abstract CustomSearchConfiguration getCustomSearchConfiguration(); - private SettingsBuilder settingsBuilder; private ElasticSearchService elasticSearchService; private GraphService graphService; @@ -211,10 +207,7 @@ private ElasticSearchService buildEntitySearchService() { QueryFilterRewriteChain.EMPTY); ESBrowseDAO browseDAO = new ESBrowseDAO( - searchClientSpy, - getSearchConfiguration(), - getCustomSearchConfiguration(), - QueryFilterRewriteChain.EMPTY); + searchClientSpy, getSearchConfiguration(), null, QueryFilterRewriteChain.EMPTY); ESWriteDAO writeDAO = new ESWriteDAO(searchClientSpy, getBulkProcessor(), 1); return new ElasticSearchService(indexBuilders, searchDAO, browseDAO, writeDAO); } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/SearchServiceTestBase.java b/metadata-io/src/test/java/com/linkedin/metadata/search/SearchServiceTestBase.java index ba83a381916c29..b20326deeb9458 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/SearchServiceTestBase.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/SearchServiceTestBase.java @@ -14,7 +14,6 @@ import com.linkedin.common.urn.Urn; import com.linkedin.metadata.config.cache.EntityDocCountCacheConfiguration; import com.linkedin.metadata.config.search.SearchConfiguration; -import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.models.registry.SnapshotEntityRegistry; import com.linkedin.metadata.query.filter.Condition; import com.linkedin.metadata.query.filter.ConjunctiveCriterion; @@ -64,9 +63,6 @@ public abstract class SearchServiceTestBase extends AbstractTestNGSpringContextT @Nonnull protected abstract SearchConfiguration getSearchConfiguration(); - @Nonnull - protected abstract CustomSearchConfiguration getCustomSearchConfiguration(); - protected OperationContext operationContext; private SettingsBuilder settingsBuilder; private ElasticSearchService elasticSearchService; @@ -136,10 +132,7 @@ private ElasticSearchService buildEntitySearchService() { QueryFilterRewriteChain.EMPTY); ESBrowseDAO browseDAO = new ESBrowseDAO( - getSearchClient(), - getSearchConfiguration(), - getCustomSearchConfiguration(), - QueryFilterRewriteChain.EMPTY); + getSearchClient(), getSearchConfiguration(), null, QueryFilterRewriteChain.EMPTY); ESWriteDAO writeDAO = new ESWriteDAO(getSearchClient(), getBulkProcessor(), 1); return new ElasticSearchService(indexBuilders, searchDAO, browseDAO, writeDAO); } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/TestEntityTestBase.java b/metadata-io/src/test/java/com/linkedin/metadata/search/TestEntityTestBase.java index 7b6fcd46333d2d..206b97ce6c1045 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/TestEntityTestBase.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/TestEntityTestBase.java @@ -13,7 +13,6 @@ import com.linkedin.metadata.browse.BrowseResult; import com.linkedin.metadata.browse.BrowseResultV2; import com.linkedin.metadata.config.search.SearchConfiguration; -import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.models.registry.SnapshotEntityRegistry; import com.linkedin.metadata.search.elasticsearch.ElasticSearchService; import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder; @@ -53,9 +52,6 @@ public abstract class TestEntityTestBase extends AbstractTestNGSpringContextTest @Nonnull protected abstract SearchConfiguration getSearchConfiguration(); - @Nonnull - protected abstract CustomSearchConfiguration getCustomSearchConfiguration(); - private SettingsBuilder settingsBuilder; private ElasticSearchService elasticSearchService; private OperationContext opContext; @@ -102,10 +98,7 @@ private ElasticSearchService buildService() { QueryFilterRewriteChain.EMPTY); ESBrowseDAO browseDAO = new ESBrowseDAO( - getSearchClient(), - getSearchConfiguration(), - getCustomSearchConfiguration(), - QueryFilterRewriteChain.EMPTY); + getSearchClient(), getSearchConfiguration(), null, QueryFilterRewriteChain.EMPTY); ESWriteDAO writeDAO = new ESWriteDAO(getSearchClient(), getBulkProcessor(), 1); ElasticSearchService searchService = new ElasticSearchService(indexBuilders, searchDAO, browseDAO, writeDAO); diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/GoldenElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/GoldenElasticSearchTest.java index 29f5964c853f13..ad30c9d0229aa6 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/GoldenElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/GoldenElasticSearchTest.java @@ -1,6 +1,6 @@ package com.linkedin.metadata.search.elasticsearch; -import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.Assert.assertNotNull; import com.linkedin.metadata.search.SearchService; import com.linkedin.metadata.search.fixtures.GoldenTestBase; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/IndexBuilderElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/IndexBuilderElasticSearchTest.java index 911a21767bdeaf..af0b7003bd1d15 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/IndexBuilderElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/IndexBuilderElasticSearchTest.java @@ -1,6 +1,6 @@ package com.linkedin.metadata.search.elasticsearch; -import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.Assert.assertNotNull; import com.linkedin.metadata.search.indexbuilder.IndexBuilderTestBase; import io.datahubproject.test.search.config.SearchTestContainerConfiguration; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/LineageDataFixtureElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/LineageDataFixtureElasticSearchTest.java index 143ae80abc52d3..fe992f61d311d6 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/LineageDataFixtureElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/LineageDataFixtureElasticSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.elasticsearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.search.LineageSearchService; import com.linkedin.metadata.search.SearchService; import com.linkedin.metadata.search.fixtures.LineageDataFixtureTestBase; @@ -10,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Getter @@ -35,6 +36,6 @@ public class LineageDataFixtureElasticSearchTest extends LineageDataFixtureTestB @Test public void initTest() { - AssertJUnit.assertNotNull(lineageService); + assertNotNull(lineageService); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/LineageServiceElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/LineageServiceElasticSearchTest.java index 28fe212734bfa6..7ccf7605432eeb 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/LineageServiceElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/LineageServiceElasticSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.elasticsearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.config.search.SearchConfiguration; import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.search.LineageServiceTestBase; @@ -12,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ @@ -55,14 +56,8 @@ protected SearchConfiguration getSearchConfiguration() { return _searchConfiguration; } - @NotNull - @Override - protected CustomSearchConfiguration getCustomSearchConfiguration() { - return _customSearchConfiguration; - } - @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SampleDataFixtureElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SampleDataFixtureElasticSearchTest.java index e256f75242a42f..68b68b289dd2c0 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SampleDataFixtureElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SampleDataFixtureElasticSearchTest.java @@ -1,8 +1,9 @@ package com.linkedin.metadata.search.elasticsearch; -import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.Assert.assertNotNull; import com.linkedin.entity.client.EntityClient; +import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.search.SearchService; import com.linkedin.metadata.search.fixtures.SampleDataFixtureTestBase; import io.datahubproject.metadata.context.OperationContext; @@ -37,6 +38,11 @@ public class SampleDataFixtureElasticSearchTest extends SampleDataFixtureTestBas @Qualifier("sampleDataOperationContext") protected OperationContext operationContext; + @Getter + @Autowired + @Qualifier("fixtureCustomSearchConfig") + protected CustomSearchConfiguration customSearchConfiguration; + @Test public void initTest() { assertNotNull(searchClient); diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SearchDAOElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SearchDAOElasticSearchTest.java index a6a8279fe86de2..3a02a7be0b4c2a 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SearchDAOElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SearchDAOElasticSearchTest.java @@ -1,6 +1,6 @@ package com.linkedin.metadata.search.elasticsearch; -import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.Assert.assertNotNull; import com.linkedin.metadata.config.search.SearchConfiguration; import com.linkedin.metadata.search.query.SearchDAOTestBase; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SearchServiceElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SearchServiceElasticSearchTest.java index 5b19200e62b2f0..92dfa18d4feeba 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SearchServiceElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SearchServiceElasticSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.elasticsearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.config.search.SearchConfiguration; import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.search.SearchServiceTestBase; @@ -12,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ @@ -55,14 +56,8 @@ protected SearchConfiguration getSearchConfiguration() { return _searchConfiguration; } - @NotNull - @Override - protected CustomSearchConfiguration getCustomSearchConfiguration() { - return _customSearchConfiguration; - } - @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SystemMetadataServiceElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SystemMetadataServiceElasticSearchTest.java index a23cd5b051ecbb..b4093459ab3f1b 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SystemMetadataServiceElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/SystemMetadataServiceElasticSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.elasticsearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder; import com.linkedin.metadata.search.elasticsearch.update.ESBulkProcessor; import com.linkedin.metadata.systemmetadata.SystemMetadataServiceTestBase; @@ -8,7 +10,6 @@ import org.opensearch.client.RestHighLevelClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ElasticSearchSuite.class, SearchTestContainerConfiguration.class}) @@ -38,6 +39,6 @@ protected ESIndexBuilder getIndexBuilder() { @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/TestEntityElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/TestEntityElasticSearchTest.java index 701e6118f5fa08..ec6f2e2b3f07a5 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/TestEntityElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/TestEntityElasticSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.elasticsearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.config.search.SearchConfiguration; import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.search.TestEntityTestBase; @@ -12,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ @@ -55,14 +56,8 @@ protected SearchConfiguration getSearchConfiguration() { return searchConfiguration; } - @NotNull - @Override - protected CustomSearchConfiguration getCustomSearchConfiguration() { - return customSearchConfiguration; - } - @Test public void initTest() { - AssertJUnit.assertNotNull(searchClient); + assertNotNull(searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/TimeseriesAspectServiceElasticSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/TimeseriesAspectServiceElasticSearchTest.java index 1f51d463a2963a..8a5f5d673aa7b9 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/TimeseriesAspectServiceElasticSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/elasticsearch/TimeseriesAspectServiceElasticSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.elasticsearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder; import com.linkedin.metadata.search.elasticsearch.update.ESBulkProcessor; import com.linkedin.metadata.timeseries.search.TimeseriesAspectServiceTestBase; @@ -9,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ElasticSearchSuite.class, SearchTestContainerConfiguration.class}) @@ -42,6 +43,6 @@ protected ESIndexBuilder getIndexBuilder() { @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/GoldenTestBase.java b/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/GoldenTestBase.java index 1ebcc03eb690bc..052daeece8cd0b 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/GoldenTestBase.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/GoldenTestBase.java @@ -4,7 +4,6 @@ import static com.linkedin.metadata.utils.CriterionUtils.buildCriterion; import static io.datahubproject.test.search.SearchTestUtils.searchAcrossEntities; import static org.testng.Assert.*; -import static org.testng.AssertJUnit.assertNotNull; import com.google.common.collect.ImmutableList; import com.linkedin.common.urn.Urn; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureSetupTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureSetupTest.java deleted file mode 100644 index b908933fcc8e37..00000000000000 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureSetupTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.linkedin.metadata.search.fixtures; - -import static org.testng.AssertJUnit.assertEquals; - -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import org.springframework.core.io.ClassPathResource; -import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; -import org.testng.annotations.Test; - -public class SampleDataFixtureSetupTest extends AbstractTestNGSpringContextTests { - private static final String DEFAULT_CONFIG = "search_config.yaml"; - private static final String TEST_FIXTURE_CONFIG = "search_config_fixture_test.yml"; - private static final YAMLMapper MAPPER = new YAMLMapper(); - - /** - * Ensure default search configuration matches the test fixture configuration (allowing for some - * differences) - */ - @Test - public void testConfig() throws IOException { - final CustomSearchConfiguration defaultConfig; - final CustomSearchConfiguration fixtureConfig; - - try (InputStream stream = new ClassPathResource(DEFAULT_CONFIG).getInputStream()) { - defaultConfig = MAPPER.readValue(stream, CustomSearchConfiguration.class); - } - try (InputStream stream = new ClassPathResource(TEST_FIXTURE_CONFIG).getInputStream()) { - fixtureConfig = MAPPER.readValue(stream, CustomSearchConfiguration.class); - - // test specifics - ((List>) - fixtureConfig.getQueryConfigurations().get(1).getFunctionScore().get("functions")) - .remove(1); - - ((List>) - fixtureConfig.getQueryConfigurations().get(2).getFunctionScore().get("functions")) - .remove(1); - } - - assertEquals(fixtureConfig, defaultConfig); - } -} diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureTestBase.java b/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureTestBase.java index eb849019b23622..2e084697380b29 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureTestBase.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureTestBase.java @@ -12,6 +12,7 @@ import static org.testng.Assert.assertSame; import static org.testng.Assert.assertTrue; +import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.linkedin.common.urn.Urn; @@ -22,6 +23,7 @@ import com.linkedin.datahub.graphql.types.corpuser.CorpUserType; import com.linkedin.datahub.graphql.types.dataset.DatasetType; import com.linkedin.entity.client.EntityClient; +import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.models.EntitySpec; import com.linkedin.metadata.models.SearchableFieldSpec; import com.linkedin.metadata.models.registry.EntityRegistry; @@ -43,6 +45,7 @@ import com.linkedin.r2.RemoteInvocationException; import io.datahubproject.metadata.context.OperationContext; import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -63,11 +66,13 @@ import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.sort.FieldSortBuilder; import org.opensearch.search.sort.SortBuilder; +import org.springframework.core.io.ClassPathResource; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; -import org.testng.AssertJUnit; import org.testng.annotations.Test; public abstract class SampleDataFixtureTestBase extends AbstractTestNGSpringContextTests { + protected static final String DEFAULT_CONFIG = "search_config.yaml"; + protected static final YAMLMapper MAPPER = new YAMLMapper(); @Nonnull protected abstract SearchService getSearchService(); @@ -81,6 +86,9 @@ public abstract class SampleDataFixtureTestBase extends AbstractTestNGSpringCont @Nonnull protected abstract OperationContext getOperationContext(); + @Nonnull + protected abstract CustomSearchConfiguration getCustomSearchConfiguration(); + @Test public void testSearchFieldConfig() throws IOException { /* @@ -2024,7 +2032,7 @@ public void testSortOrdering() { @Test public void testFilterOnHasValuesField() { - AssertJUnit.assertNotNull(getSearchService()); + assertNotNull(getSearchService()); Filter filter = new Filter() .setOr( @@ -2046,7 +2054,7 @@ public void testFilterOnHasValuesField() { @Test public void testFilterOnNumValuesField() { - AssertJUnit.assertNotNull(getSearchService()); + assertNotNull(getSearchService()); Filter filter = new Filter() .setOr( @@ -2066,6 +2074,34 @@ public void testFilterOnNumValuesField() { assertEquals(searchResult.getEntities().size(), 4); } + /** + * Ensure default search configuration matches the test fixture configuration (allowing for some + * differences) + */ + @Test + public void testConfig() throws IOException { + final CustomSearchConfiguration defaultConfig; + try (InputStream stream = new ClassPathResource(DEFAULT_CONFIG).getInputStream()) { + defaultConfig = MAPPER.readValue(stream, CustomSearchConfiguration.class); + } + + final CustomSearchConfiguration fixtureConfig = + MAPPER.readValue( + MAPPER.writeValueAsBytes(getCustomSearchConfiguration()), + CustomSearchConfiguration.class); + + // test specifics + ((List>) + fixtureConfig.getQueryConfigurations().get(1).getFunctionScore().get("functions")) + .remove(1); + + ((List>) + fixtureConfig.getQueryConfigurations().get(2).getFunctionScore().get("functions")) + .remove(1); + + assertEquals(fixtureConfig, defaultConfig); + } + private Stream getTokens(AnalyzeRequest request) throws IOException { return getSearchClient() diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/GoldenOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/GoldenOpenSearchTest.java index db39531bba08c6..9e105a69de5d14 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/GoldenOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/GoldenOpenSearchTest.java @@ -1,6 +1,6 @@ package com.linkedin.metadata.search.opensearch; -import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.Assert.assertNotNull; import com.linkedin.metadata.search.SearchService; import com.linkedin.metadata.search.fixtures.GoldenTestBase; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/IndexBuilderOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/IndexBuilderOpenSearchTest.java index ef1ed51eb47991..01a9fc84c83a6f 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/IndexBuilderOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/IndexBuilderOpenSearchTest.java @@ -1,6 +1,6 @@ package com.linkedin.metadata.search.opensearch; -import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.Assert.assertNotNull; import com.linkedin.metadata.search.indexbuilder.IndexBuilderTestBase; import io.datahubproject.test.search.config.SearchTestContainerConfiguration; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/LineageDataFixtureOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/LineageDataFixtureOpenSearchTest.java index 98ac4013443524..ec1c485cc0f551 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/LineageDataFixtureOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/LineageDataFixtureOpenSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.opensearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.search.LineageSearchService; import com.linkedin.metadata.search.SearchService; import com.linkedin.metadata.search.fixtures.LineageDataFixtureTestBase; @@ -10,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Getter @@ -35,6 +36,6 @@ public class LineageDataFixtureOpenSearchTest extends LineageDataFixtureTestBase @Test public void initTest() { - AssertJUnit.assertNotNull(lineageService); + assertNotNull(lineageService); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/LineageServiceOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/LineageServiceOpenSearchTest.java index 5759dafffc7b63..d24501d118925e 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/LineageServiceOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/LineageServiceOpenSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.opensearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.config.search.SearchConfiguration; import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.search.LineageServiceTestBase; @@ -12,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ @@ -55,14 +56,8 @@ protected SearchConfiguration getSearchConfiguration() { return _searchConfiguration; } - @NotNull - @Override - protected CustomSearchConfiguration getCustomSearchConfiguration() { - return _customSearchConfiguration; - } - @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SampleDataFixtureOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SampleDataFixtureOpenSearchTest.java index 5d47e6ffd6fa5c..4bf8465b14ac9d 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SampleDataFixtureOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SampleDataFixtureOpenSearchTest.java @@ -1,8 +1,9 @@ package com.linkedin.metadata.search.opensearch; -import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.Assert.assertNotNull; import com.linkedin.entity.client.EntityClient; +import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.search.SearchService; import com.linkedin.metadata.search.fixtures.SampleDataFixtureTestBase; import io.datahubproject.metadata.context.OperationContext; @@ -37,6 +38,11 @@ public class SampleDataFixtureOpenSearchTest extends SampleDataFixtureTestBase { @Qualifier("sampleDataOperationContext") protected OperationContext operationContext; + @Getter + @Autowired + @Qualifier("fixtureCustomSearchConfig") + protected CustomSearchConfiguration customSearchConfiguration; + @Test public void initTest() { assertNotNull(searchClient); diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SearchDAOOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SearchDAOOpenSearchTest.java index a3a767807d7b9d..9061b109f51c06 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SearchDAOOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SearchDAOOpenSearchTest.java @@ -1,6 +1,6 @@ package com.linkedin.metadata.search.opensearch; -import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.Assert.assertNotNull; import com.linkedin.metadata.config.search.SearchConfiguration; import com.linkedin.metadata.search.query.SearchDAOTestBase; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SearchServiceOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SearchServiceOpenSearchTest.java index 41f87d52b8847c..ab1137c94f2f43 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SearchServiceOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SearchServiceOpenSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.opensearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.config.search.SearchConfiguration; import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.search.SearchServiceTestBase; @@ -12,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ @@ -55,14 +56,8 @@ protected SearchConfiguration getSearchConfiguration() { return _searchConfiguration; } - @NotNull - @Override - protected CustomSearchConfiguration getCustomSearchConfiguration() { - return _customSearchConfiguration; - } - @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SystemMetadataServiceOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SystemMetadataServiceOpenSearchTest.java index 7ba90319cf1d3e..46bf30fcedafb8 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SystemMetadataServiceOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/SystemMetadataServiceOpenSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.opensearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder; import com.linkedin.metadata.search.elasticsearch.update.ESBulkProcessor; import com.linkedin.metadata.systemmetadata.SystemMetadataServiceTestBase; @@ -8,7 +10,6 @@ import org.opensearch.client.RestHighLevelClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({OpenSearchSuite.class, SearchTestContainerConfiguration.class}) @@ -38,6 +39,6 @@ protected ESIndexBuilder getIndexBuilder() { @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/TestEntityOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/TestEntityOpenSearchTest.java index f4b69929d8e1a2..96adf052cde456 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/TestEntityOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/TestEntityOpenSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.opensearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.config.search.SearchConfiguration; import com.linkedin.metadata.config.search.custom.CustomSearchConfiguration; import com.linkedin.metadata.search.TestEntityTestBase; @@ -12,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({ @@ -55,14 +56,8 @@ protected SearchConfiguration getSearchConfiguration() { return _searchConfiguration; } - @NotNull - @Override - protected CustomSearchConfiguration getCustomSearchConfiguration() { - return _customSearchConfiguration; - } - @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/TimeseriesAspectServiceOpenSearchTest.java b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/TimeseriesAspectServiceOpenSearchTest.java index 16ac03415ee5c2..b60ba08d9785bf 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/TimeseriesAspectServiceOpenSearchTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/opensearch/TimeseriesAspectServiceOpenSearchTest.java @@ -1,5 +1,7 @@ package com.linkedin.metadata.search.opensearch; +import static org.testng.Assert.assertNotNull; + import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder; import com.linkedin.metadata.search.elasticsearch.update.ESBulkProcessor; import com.linkedin.metadata.timeseries.search.TimeseriesAspectServiceTestBase; @@ -9,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Import; -import org.testng.AssertJUnit; import org.testng.annotations.Test; @Import({OpenSearchSuite.class, SearchTestContainerConfiguration.class}) @@ -42,6 +43,6 @@ protected ESIndexBuilder getIndexBuilder() { @Test public void initTest() { - AssertJUnit.assertNotNull(_searchClient); + assertNotNull(_searchClient); } } diff --git a/metadata-io/src/test/java/com/linkedin/metadata/structuredproperties/validators/PropertyDefinitionValidatorTest.java b/metadata-io/src/test/java/com/linkedin/metadata/structuredproperties/validators/PropertyDefinitionValidatorTest.java index 22224f16f2210b..2af731a51145e3 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/structuredproperties/validators/PropertyDefinitionValidatorTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/structuredproperties/validators/PropertyDefinitionValidatorTest.java @@ -2,7 +2,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import static org.testng.AssertJUnit.assertEquals; +import static org.testng.Assert.assertEquals; import com.linkedin.common.UrnArray; import com.linkedin.common.urn.Urn; diff --git a/metadata-io/src/test/java/com/linkedin/metadata/timeline/eventgenerator/SchemaMetadataChangeEventGeneratorTest.java b/metadata-io/src/test/java/com/linkedin/metadata/timeline/eventgenerator/SchemaMetadataChangeEventGeneratorTest.java index d8d33f4c356bb8..772ef374af18b0 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/timeline/eventgenerator/SchemaMetadataChangeEventGeneratorTest.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/timeline/eventgenerator/SchemaMetadataChangeEventGeneratorTest.java @@ -1,6 +1,6 @@ package com.linkedin.metadata.timeline.eventgenerator; -import static org.testng.AssertJUnit.assertEquals; +import static org.testng.Assert.assertEquals; import com.linkedin.common.AuditStamp; import com.linkedin.common.urn.Urn; diff --git a/metadata-io/src/test/java/io/datahubproject/test/fixtures/search/SearchLineageFixtureConfiguration.java b/metadata-io/src/test/java/io/datahubproject/test/fixtures/search/SearchLineageFixtureConfiguration.java index 059749e04f6a4d..889473d32d1a35 100644 --- a/metadata-io/src/test/java/io/datahubproject/test/fixtures/search/SearchLineageFixtureConfiguration.java +++ b/metadata-io/src/test/java/io/datahubproject/test/fixtures/search/SearchLineageFixtureConfiguration.java @@ -143,7 +143,7 @@ protected ElasticSearchService entitySearchService( false, ELASTICSEARCH_IMPLEMENTATION_ELASTICSEARCH, searchConfiguration, - null, + customSearchConfiguration, queryFilterRewriteChain); ESBrowseDAO browseDAO = new ESBrowseDAO(