Skip to content

Commit

Permalink
fix(graphql): removed duplicated entity in EntityTypeUrnMapper (#12406)
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterchen09 authored Jan 20, 2025
1 parent 2109abd commit a20f660
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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");
}
}

0 comments on commit a20f660

Please sign in to comment.