mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-26 01:18:20 +00:00
fix(graphql): removed duplicated entity in EntityTypeUrnMapper (#12406)
This commit is contained in:
parent
2109abdc1a
commit
a20f660ac1
@ -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 =
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user