Skip to content

Instantly share code, notes, and snippets.

@aweisser
Last active July 29, 2016 20:33
Show Gist options
  • Save aweisser/05442f28bad33265cca2fb2cfd94d324 to your computer and use it in GitHub Desktop.
Save aweisser/05442f28bad33265cca2fb2cfd94d324 to your computer and use it in GitHub Desktop.
uriParamsShouldNotBeNull
@Test
public void uriParamsShouldNotBeNull() {
String raml =
"#%RAML 0.8\n" +
"title: myapi\n" +
"baseUri: /\n" +
"version: 1\n" +
"\n" +
"/endpointWithURIParam:\n" +
" /{uriParam}:\n" +
" get:";
RamlModelResult ramlModelResult = new RamlModelBuilder().buildApi(raml, ".");
Api api = ramlModelResult.getApiV08();
Resource endpointWithURIParam = api.resources().get(0);
assertThat(endpointWithURIParam.displayName(), Matchers.equalTo("/endpointWithURIParam"));
Resource uriParam = endpointWithURIParam.resources().get(0);
assertThat(uriParam.displayName(), Matchers.equalTo("/{uriParam}"));
// THIS FAILS. Why?
assertThat(uriParam.uriParameters(), Matchers.hasSize(1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment