forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'datahub-project:master' into master
- Loading branch information
Showing
49 changed files
with
1,239 additions
and
725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...src/test/java/com/linkedin/datahub/graphql/types/dataflow/mappers/DataFlowMapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.linkedin.datahub.graphql.types.dataflow.mappers; | ||
|
||
import com.linkedin.common.urn.Urn; | ||
import com.linkedin.datahub.graphql.generated.DataFlow; | ||
import com.linkedin.entity.Aspect; | ||
import com.linkedin.entity.EntityResponse; | ||
import com.linkedin.entity.EnvelopedAspect; | ||
import com.linkedin.entity.EnvelopedAspectMap; | ||
import com.linkedin.metadata.Constants; | ||
import java.net.URISyntaxException; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
public class DataFlowMapperTest { | ||
private static final Urn TEST_DATA_FLOW_URN = | ||
Urn.createFromTuple(Constants.DATA_FLOW_ENTITY_NAME, "dataflow1"); | ||
private static final Urn TEST_CONTAINER_URN = | ||
Urn.createFromTuple(Constants.CONTAINER_ENTITY_NAME, "container1"); | ||
|
||
@Test | ||
public void testMapDataFlowContainer() throws URISyntaxException { | ||
com.linkedin.container.Container input = new com.linkedin.container.Container(); | ||
input.setContainer(TEST_CONTAINER_URN); | ||
|
||
final Map<String, EnvelopedAspect> containerAspect = new HashMap<>(); | ||
containerAspect.put( | ||
Constants.CONTAINER_ASPECT_NAME, | ||
new com.linkedin.entity.EnvelopedAspect().setValue(new Aspect(input.data()))); | ||
final EntityResponse response = | ||
new EntityResponse() | ||
.setEntityName(Constants.DATA_FLOW_ENTITY_NAME) | ||
.setUrn(TEST_DATA_FLOW_URN) | ||
.setAspects(new EnvelopedAspectMap(containerAspect)); | ||
|
||
final DataFlow actual = DataFlowMapper.map(null, response); | ||
|
||
Assert.assertEquals(actual.getUrn(), TEST_DATA_FLOW_URN.toString()); | ||
Assert.assertEquals(actual.getContainer().getUrn(), TEST_CONTAINER_URN.toString()); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...e/src/test/java/com/linkedin/datahub/graphql/types/datajob/mappers/DataJobMapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.linkedin.datahub.graphql.types.datajob.mappers; | ||
|
||
import com.linkedin.common.urn.Urn; | ||
import com.linkedin.datahub.graphql.generated.DataJob; | ||
import com.linkedin.entity.Aspect; | ||
import com.linkedin.entity.EntityResponse; | ||
import com.linkedin.entity.EnvelopedAspect; | ||
import com.linkedin.entity.EnvelopedAspectMap; | ||
import com.linkedin.metadata.Constants; | ||
import java.net.URISyntaxException; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
public class DataJobMapperTest { | ||
private static final Urn TEST_DATA_JOB_URN = | ||
Urn.createFromTuple(Constants.DATA_JOB_ENTITY_NAME, "datajob1"); | ||
private static final Urn TEST_CONTAINER_URN = | ||
Urn.createFromTuple(Constants.CONTAINER_ENTITY_NAME, "container1"); | ||
|
||
@Test | ||
public void testMapDataJobContainer() throws URISyntaxException { | ||
com.linkedin.container.Container input = new com.linkedin.container.Container(); | ||
input.setContainer(TEST_CONTAINER_URN); | ||
|
||
final Map<String, EnvelopedAspect> containerAspect = new HashMap<>(); | ||
containerAspect.put( | ||
Constants.CONTAINER_ASPECT_NAME, | ||
new com.linkedin.entity.EnvelopedAspect().setValue(new Aspect(input.data()))); | ||
final EntityResponse response = | ||
new EntityResponse() | ||
.setEntityName(Constants.DATA_JOB_ENTITY_NAME) | ||
.setUrn(TEST_DATA_JOB_URN) | ||
.setAspects(new EnvelopedAspectMap(containerAspect)); | ||
|
||
final DataJob actual = DataJobMapper.map(null, response); | ||
|
||
Assert.assertEquals(actual.getUrn(), TEST_DATA_JOB_URN.toString()); | ||
Assert.assertEquals(actual.getContainer().getUrn(), TEST_CONTAINER_URN.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.