fix(graphql): removed duplicated entity in EntityTypeUrnMapper (#12406)

This commit is contained in:
Felix Lüdin 2025-01-20 23:57:22 +01:00 committed by GitHub
parent 2109abdc1a
commit a20f660ac1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 50 additions and 3 deletions

View File

@ -77,9 +77,6 @@ public class EntityTypeUrnMapper {
.put(
Constants.BUSINESS_ATTRIBUTE_ENTITY_NAME,
"urn:li:entityType:datahub.businessAttribute")
.put(
Constants.DATA_PROCESS_INSTANCE_ENTITY_NAME,
"urn:li:entityType:datahub.dataProcessInstance")
.build();
private static final Map<String, String> ENTITY_TYPE_URN_TO_NAME =

View File

@ -0,0 +1,20 @@
package com.linkedin.datahub.graphql.types.entitytype;
import static org.testng.Assert.*;
import com.linkedin.datahub.graphql.generated.EntityType;
import com.linkedin.metadata.Constants;
import org.testng.annotations.Test;
public class EntityTypeMapperTest {
@Test
public void testGetType() throws Exception {
assertEquals(EntityTypeMapper.getType(Constants.DATASET_ENTITY_NAME), EntityType.DATASET);
}
@Test
public void testGetName() throws Exception {
assertEquals(EntityTypeMapper.getName(EntityType.DATASET), Constants.DATASET_ENTITY_NAME);
}
}

View File

@ -0,0 +1,30 @@
package com.linkedin.datahub.graphql.types.entitytype;
import static org.testng.Assert.*;
import com.linkedin.datahub.graphql.generated.EntityType;
import com.linkedin.metadata.Constants;
import org.testng.annotations.Test;
public class EntityTypeUrnMapperTest {
@Test
public void testGetName() throws Exception {
assertEquals(
EntityTypeUrnMapper.getName("urn:li:entityType:datahub.dataset"),
Constants.DATASET_ENTITY_NAME);
}
@Test
public void testGetEntityType() throws Exception {
assertEquals(
EntityTypeUrnMapper.getEntityType("urn:li:entityType:datahub.dataset"), EntityType.DATASET);
}
@Test
public void testGetEntityTypeUrn() throws Exception {
assertEquals(
EntityTypeUrnMapper.getEntityTypeUrn(Constants.DATASET_ENTITY_NAME),
"urn:li:entityType:datahub.dataset");
}
}