Skip to content

Commit a20f660

Browse files
authored
fix(graphql): removed duplicated entity in EntityTypeUrnMapper (#12406)
1 parent 2109abd commit a20f660

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/entitytype/EntityTypeUrnMapper.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ public class EntityTypeUrnMapper {
7777
.put(
7878
Constants.BUSINESS_ATTRIBUTE_ENTITY_NAME,
7979
"urn:li:entityType:datahub.businessAttribute")
80-
.put(
81-
Constants.DATA_PROCESS_INSTANCE_ENTITY_NAME,
82-
"urn:li:entityType:datahub.dataProcessInstance")
8380
.build();
8481

8582
private static final Map<String, String> ENTITY_TYPE_URN_TO_NAME =
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.linkedin.datahub.graphql.types.entitytype;
2+
3+
import static org.testng.Assert.*;
4+
5+
import com.linkedin.datahub.graphql.generated.EntityType;
6+
import com.linkedin.metadata.Constants;
7+
import org.testng.annotations.Test;
8+
9+
public class EntityTypeMapperTest {
10+
11+
@Test
12+
public void testGetType() throws Exception {
13+
assertEquals(EntityTypeMapper.getType(Constants.DATASET_ENTITY_NAME), EntityType.DATASET);
14+
}
15+
16+
@Test
17+
public void testGetName() throws Exception {
18+
assertEquals(EntityTypeMapper.getName(EntityType.DATASET), Constants.DATASET_ENTITY_NAME);
19+
}
20+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.linkedin.datahub.graphql.types.entitytype;
2+
3+
import static org.testng.Assert.*;
4+
5+
import com.linkedin.datahub.graphql.generated.EntityType;
6+
import com.linkedin.metadata.Constants;
7+
import org.testng.annotations.Test;
8+
9+
public class EntityTypeUrnMapperTest {
10+
11+
@Test
12+
public void testGetName() throws Exception {
13+
assertEquals(
14+
EntityTypeUrnMapper.getName("urn:li:entityType:datahub.dataset"),
15+
Constants.DATASET_ENTITY_NAME);
16+
}
17+
18+
@Test
19+
public void testGetEntityType() throws Exception {
20+
assertEquals(
21+
EntityTypeUrnMapper.getEntityType("urn:li:entityType:datahub.dataset"), EntityType.DATASET);
22+
}
23+
24+
@Test
25+
public void testGetEntityTypeUrn() throws Exception {
26+
assertEquals(
27+
EntityTypeUrnMapper.getEntityTypeUrn(Constants.DATASET_ENTITY_NAME),
28+
"urn:li:entityType:datahub.dataset");
29+
}
30+
}

0 commit comments

Comments
 (0)