From 5a6923cf66dfe7de1f3fecbedb4d967da1a3d65e Mon Sep 17 00:00:00 2001 From: RyanHolstien Date: Wed, 15 Jan 2025 19:08:38 -0600 Subject: [PATCH] fix tests --- .../entity/versioning/LinkAssetVersionResolverTest.java | 5 +++-- .../entity/versioning/UnlinkAssetVersionResolverTest.java | 2 +- .../resolvers/versioning/VersionsSearchResolverTest.java | 7 ++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/entity/versioning/LinkAssetVersionResolverTest.java b/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/entity/versioning/LinkAssetVersionResolverTest.java index 690856263fccc..ef97ebf6791e6 100644 --- a/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/entity/versioning/LinkAssetVersionResolverTest.java +++ b/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/entity/versioning/LinkAssetVersionResolverTest.java @@ -11,6 +11,7 @@ import com.linkedin.datahub.graphql.QueryContext; import com.linkedin.datahub.graphql.featureflags.FeatureFlags; import com.linkedin.datahub.graphql.generated.LinkVersionInput; +import com.linkedin.datahub.graphql.generated.VersionSet; import com.linkedin.metadata.entity.IngestResult; import com.linkedin.metadata.entity.versioning.EntityVersioningService; import com.linkedin.metadata.entity.versioning.VersionPropertiesInput; @@ -56,8 +57,8 @@ public void testGetSuccessful() throws Exception { Mockito.when(mockEnv.getArgument(Mockito.eq("input"))).thenReturn(input); Mockito.when(mockEnv.getContext()).thenReturn(mockContext); - String result = resolver.get(mockEnv).get(); - assertEquals(result, TEST_ENTITY_URN); + VersionSet result = resolver.get(mockEnv).get(); + assertEquals(result.getUrn(), TEST_ENTITY_URN); } @Test diff --git a/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/entity/versioning/UnlinkAssetVersionResolverTest.java b/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/entity/versioning/UnlinkAssetVersionResolverTest.java index 0000ad24a0453..0896066656c4b 100644 --- a/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/entity/versioning/UnlinkAssetVersionResolverTest.java +++ b/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/entity/versioning/UnlinkAssetVersionResolverTest.java @@ -48,7 +48,7 @@ public void testGetSuccessful() throws Exception { Mockito.when(mockEnv.getArgument(Mockito.eq("input"))).thenReturn(input); Mockito.when(mockEnv.getContext()).thenReturn(mockContext); - assertTrue(resolver.get(mockEnv).get()); + assertNotNull(resolver.get(mockEnv).get()); Mockito.verify(mockService) .unlinkVersion( diff --git a/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/versioning/VersionsSearchResolverTest.java b/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/versioning/VersionsSearchResolverTest.java index eb070cf293f69..3554df074df69 100644 --- a/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/versioning/VersionsSearchResolverTest.java +++ b/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/versioning/VersionsSearchResolverTest.java @@ -52,7 +52,7 @@ public class VersionsSearchResolverTest { private static final SearchAcrossEntitiesInput BASIC_INPUT = new SearchAcrossEntitiesInput( - List.of(EntityType.DATASET), "", 0, 10, null, null, null, null, null, null, null, null); + List.of(EntityType.DATASET), "", 0, 10, null, null, null, null, null); private static final SearchAcrossEntitiesInput COMPLEX_INPUT = new SearchAcrossEntitiesInput( @@ -99,10 +99,7 @@ public class VersionsSearchResolverTest { .setField("sortField2") .setSortOrder(SortOrder.ASCENDING) .build())) - .build(), - null, - null, - null); + .build()); @Test public void testGetSuccessBasic() throws Exception {