mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-03 04:10:43 +00:00
fix(tags): Support null tagProperties aspect when updating tag color (#13572)
Co-authored-by: John Joyce <john@Mac.lan>
This commit is contained in:
parent
822be781cd
commit
3a81adb94a
@ -67,7 +67,7 @@ public class SetTagColorResolver implements DataFetcher<CompletableFuture<Boolea
|
||||
tagUrn.toString(),
|
||||
TAG_PROPERTIES_ASPECT_NAME,
|
||||
_entityService,
|
||||
null);
|
||||
new TagProperties().setName(tagUrn.getId()));
|
||||
|
||||
if (tagProperties == null) {
|
||||
throw new IllegalArgumentException(
|
||||
|
||||
@ -76,7 +76,7 @@ public class SetTagColorResolverTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetFailureNoExistingProperties() throws Exception {
|
||||
public void testGetDefaultPropertiesIfNoExistingProperties() throws Exception {
|
||||
// Create resolver
|
||||
EntityClient mockClient = Mockito.mock(EntityClient.class);
|
||||
EntityService<?> mockService = getMockEntityService();
|
||||
@ -101,9 +101,21 @@ public class SetTagColorResolverTest {
|
||||
Mockito.when(mockEnv.getArgument(Mockito.eq("urn"))).thenReturn(TEST_ENTITY_URN);
|
||||
Mockito.when(mockEnv.getArgument(Mockito.eq("colorHex"))).thenReturn(TEST_COLOR_HEX);
|
||||
Mockito.when(mockEnv.getContext()).thenReturn(mockContext);
|
||||
assertThrows(CompletionException.class, () -> resolver.get(mockEnv).join());
|
||||
|
||||
Mockito.verify(mockClient, Mockito.times(0)).ingestProposal(any(), Mockito.any(), anyBoolean());
|
||||
boolean result = resolver.get(mockEnv).get();
|
||||
|
||||
assertTrue(result);
|
||||
|
||||
final TagProperties newTagProperties =
|
||||
new TagProperties().setName("test-tag").setColorHex(TEST_COLOR_HEX);
|
||||
final MetadataChangeProposal proposal =
|
||||
MutationUtils.buildMetadataChangeProposalWithUrn(
|
||||
UrnUtils.getUrn(TEST_ENTITY_URN), TAG_PROPERTIES_ASPECT_NAME, newTagProperties);
|
||||
|
||||
verifyIngestProposal(mockClient, 1, proposal);
|
||||
|
||||
Mockito.verify(mockService, Mockito.times(1))
|
||||
.exists(any(), Mockito.eq(Urn.createFromString(TEST_ENTITY_URN)), eq(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@ -32,7 +32,7 @@ const EmptyTags = ({ isEmptySearch }: Props) => {
|
||||
<div>
|
||||
{!isEmptySearch && (
|
||||
<Typography.Paragraph>
|
||||
Tags can be used to organize and categorize data assets across the platform.
|
||||
Tags can be used to organize data assets in DataHub.
|
||||
</Typography.Paragraph>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user