}
@Test
public void fullConfig()
{
Raml raml = parseRaml(ramlSource);
//documentation
List<DocumentationItem> documentation = raml.getDocumentation();
assertThat(documentation.size(), is(2));
assertThat(documentation.get(0).getTitle(), is("Home"));
assertThat(documentation.get(0).getContent(), startsWith("Lorem ipsum dolor sit"));
assertThat(documentation.get(1).getTitle(), is("section"));
assertThat(documentation.get(1).getContent(), is("section content"));
//basic attributes
assertThat(raml.getTitle(), is("Sample API"));
assertThat(raml.getVersion(), is("v1"));
String baseUri = "https://{host}.sample.com:{port}/{path}";
String basePath = "/{path}";
assertThat(raml.getBaseUri(), is(baseUri));
assertThat(raml.getBasePath(), is(basePath));
assertThat(raml.getUri(), is(""));
assertThat(raml.getProtocols().size(), is(2));
assertThat(raml.getProtocols().get(0), is(HTTP));
assertThat(raml.getProtocols().get(1), is(HTTPS));
//uri parameters
assertThat(raml.getBaseUriParameters().size(), is(3));
Map<String, UriParameter> tagUriParameters = raml.getResource("/tags/{tagId}").getUriParameters();
assertThat(tagUriParameters.size(), is(1));
assertThat(tagUriParameters.get("tagId").getDisplayName(), is("tagId"));
assertThat(tagUriParameters.get("tagId").isRequired(), is(true));
assertThat(tagUriParameters.get("tagId").getType(), is(ParamType.STRING));
UriParameter hostParam = raml.getBaseUriParameters().get("host");
assertThat(hostParam.getDisplayName(), is("Host"));
assertThat(hostParam.getDescription(), is("host name"));
assertThat(hostParam.getType(), is(STRING));
assertThat(hostParam.getMinLength(), is(5));
assertThat(hostParam.getMaxLength(), is(10));
assertThat(hostParam.getPattern(), is("[a-z]*"));
UriParameter portParam = raml.getBaseUriParameters().get("port");
assertThat(portParam.getType(), is(INTEGER));
assertThat(portParam.getMinimum(), is(new BigDecimal(1025)));
assertThat(portParam.getMaximum(), is(new BigDecimal(65535)));
assertThat(hostParam.getType(), is(STRING));
UriParameter pathParam = raml.getBaseUriParameters().get("path");
assertThat(pathParam.getType(), is(STRING));
assertThat(pathParam.getEnumeration().size(), is(3));
assertThat(pathParam.getEnumeration().get(0), is("one"));
assertThat(pathParam.getEnumeration().get(1), is("two"));
assertThat(pathParam.getEnumeration().get(2), is("three"));
//resources
assertThat(raml.getResources().size(), is(3));
String rootUri = "/";
Resource rootResource = raml.getResources().get(rootUri);
assertThat(rootResource.getRelativeUri(), is(rootUri));
assertThat(rootResource.getUri(), is(rootUri));
assertThat(rootResource.getDisplayName(), is("Root resource"));
assertThat(rootResource.getDescription(), is("Root resource description"));
assertThat(rootResource.getAction(ActionType.HEAD).getProtocols().size(), is(1));
assertThat(rootResource.getAction(ActionType.HEAD).getProtocols().get(0), is(HTTP));
String mediaUri = "/media";
Resource mediaResource = raml.getResources().get(mediaUri);
assertThat(mediaResource.getRelativeUri(), is(mediaUri));
assertThat(mediaResource.getUri(), is(mediaUri));
assertThat(mediaResource.getDisplayName(), is("Media collection"));
//actions