#271 - UriTemplate now correctly expands non-optional path segments.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -232,6 +232,16 @@ public class UriTemplateUnitTest {
|
||||
assertThat(result.getVariableNames(), is(empty()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #271
|
||||
*/
|
||||
@Test
|
||||
public void expandASimplePathVariable() {
|
||||
|
||||
UriTemplate template = new UriTemplate("/foo/{id}");
|
||||
assertThat(template.expand(2).toString(), is("/foo/2"));
|
||||
}
|
||||
|
||||
private static void assertVariables(UriTemplate template, TemplateVariable... variables) {
|
||||
assertVariables(template, Arrays.asList(variables));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user