-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
namespaces: allow '=' and ';' in names (#1936)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
- Loading branch information
1 parent
b583633
commit ef063d7
Showing
3 changed files
with
36 additions
and
5 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
31 changes: 31 additions & 0 deletions
31
api/src/test/java/marquez/common/models/NamespaceNameTest.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,31 @@ | ||
package marquez.common.models; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.ValueSource; | ||
|
||
@org.junit.jupiter.api.Tag("UnitTests") | ||
public class NamespaceNameTest { | ||
|
||
@ParameterizedTest | ||
@ValueSource( | ||
strings = { | ||
"DEFAULT", | ||
"database://localhost:1234", | ||
"s3://bucket", | ||
"bigquery:", | ||
"sqlserver://synapse-test-test001.sql.azuresynapse.net;databaseName=TESTPOOL1;", | ||
"\u003D" | ||
}) | ||
void testValidNamespaceName(String name) { | ||
assertThat(NamespaceName.of(name).getValue()).isEqualTo(name); | ||
} | ||
|
||
@ParameterizedTest | ||
@ValueSource(strings = {"@@@", "\uD83D\uDE02", "!", ""}) | ||
void testInvalidNamespaceName(String name) { | ||
Assertions.assertThrows(IllegalArgumentException.class, () -> NamespaceName.of(name)); | ||
} | ||
} |