Allow UriTemplate to be built with an empty template
See gh-32432
This commit is contained in:
committed by
Stéphane Nicoll
parent
723c94e5ac
commit
1b25a1506a
@@ -27,6 +27,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
import static org.assertj.core.api.Assertions.assertThatNoException;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
@@ -218,4 +219,14 @@ class UriTemplateTests {
|
||||
assertThat(uri.toString()).isEqualTo("http://localhost/query=foo@bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
void emptyPathDoesNotThrowException() {
|
||||
assertThatNoException().isThrownBy(() -> new UriTemplate(""));
|
||||
}
|
||||
|
||||
@Test
|
||||
void emptyPathThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new UriTemplate(null));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user