-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b31103
commit 3b3c1b8
Showing
3 changed files
with
47 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,36 @@ public void testValidateDatasetUrn() { | |
// If no exception is thrown, test passes | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
@Test | ||
public void testSimpleUrnColon() { | ||
Urn invalidUrn = UrnUtils.getUrn("urn:li:corpuser:foo:bar"); | ||
ValidationApiUtils.validateUrn(entityRegistry, invalidUrn, true); | ||
ValidationApiUtils.validateUrn( | ||
entityRegistry, UrnUtils.getUrn("urn:li:corpuser:foo:bar"), true); | ||
ValidationApiUtils.validateUrn( | ||
entityRegistry, UrnUtils.getUrn("urn:li:dataPlatform:abc:def"), true); | ||
ValidationApiUtils.validateUrn( | ||
entityRegistry, UrnUtils.getUrn("urn:li:corpuser:foo:[email protected]"), true); | ||
// If no exception is thrown, test passes | ||
} | ||
|
||
@Test | ||
public void testSimpleUrnComma() { | ||
ValidationApiUtils.validateUrn(entityRegistry, UrnUtils.getUrn("urn:li:corpuser:,"), true); | ||
// If no exception is thrown, test passes | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testTupleUrnComma() { | ||
ValidationApiUtils.validateUrn( | ||
entityRegistry, UrnUtils.getUrn("urn:li:dashboard:(looker,dashboards,thelook)"), true); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testFabricTypeCasing() { | ||
// prod != PROD | ||
ValidationApiUtils.validateUrn( | ||
entityRegistry, | ||
UrnUtils.getUrn("urn:li:dataset:(urn:li:dataPlatform:abc:def,table_name,prod)"), | ||
true); | ||
} | ||
|
||
@Test | ||
|
@@ -34,7 +60,7 @@ public void testComplexUrnColon() throws URISyntaxException { | |
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testUrnFabricType() { | ||
public void testFabricTypeParen() { | ||
Urn invalidUrn = UrnUtils.getUrn("urn:li:dataset:(urn:li:dataPlatform:hdfs,/path/to/data,())"); | ||
ValidationApiUtils.validateUrn(entityRegistry, invalidUrn, true); | ||
} | ||
|
@@ -119,15 +145,10 @@ public void testValidColon() { | |
// If no exception is thrown, test passes | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testNoTupleColon() { | ||
Urn invalidUrn = UrnUtils.getUrn("urn:li:corpuser::"); | ||
ValidationApiUtils.validateUrn(entityRegistry, invalidUrn, true); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
@Test | ||
public void testNoTupleComma() { | ||
Urn invalidUrn = UrnUtils.getUrn("urn:li:corpuser:,"); | ||
ValidationApiUtils.validateUrn(entityRegistry, invalidUrn, true); | ||
// If no exception is thrown, test passes | ||
} | ||
} |