Last active
July 29, 2016 20:33
-
-
Save aweisser/05442f28bad33265cca2fb2cfd94d324 to your computer and use it in GitHub Desktop.
uriParamsShouldNotBeNull
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
@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