Added check for illegal characters when creating an encoded UriComponents object

This commit is contained in:
Arjen Poutsma
2011-11-03 11:57:25 +00:00
parent c290a4e68a
commit 78fbceff82
3 changed files with 123 additions and 22 deletions

View File

@@ -59,4 +59,15 @@ public class UriComponentsTests {
UriComponentsBuilder.fromPath("/{foo}").build().encode().expand("bar");
}
@Test(expected = IllegalArgumentException.class)
public void invalidCharacters() {
UriComponentsBuilder.fromPath("/{foo}").build(true);
}
@Test(expected = IllegalArgumentException.class)
public void invalidEncodedSequence() {
UriComponentsBuilder.fromPath("/fo%2o").build(true);
}
}