Package org.raml.model.parameter

Examples of org.raml.model.parameter.Header


        Resource resource = new Resource();
        resource.setActions(buildMap(ActionType.GET, action));

        SecuritySchemeDescriptor describedBy = new SecuritySchemeDescriptor();
        describedBy.setHeaders(buildMap(new Header()));

        SecurityScheme securityScheme = new SecurityScheme();
        securityScheme.setDescribedBy(describedBy);
        securityScheme.setSettings(new SecuritySettings());
View Full Code Here


    }

    @Test
    public void emptyHeader()
    {
        Header header = raml.getResources().get("/car").getAction(PUT).getHeaders().get("enable-turbo");
        assertThat(header.getEnumeration().size(), is(3));
        assertThat(header.getEnumeration().get(0), is(""));
        List<ValidationResult> validationResults = validateRaml(ramlSource);
        assertThat(validationResults.size(), is(0));
    }
View Full Code Here

        assertThat(action.getType(), is(ActionType.GET));
        assertThat(action.getDescription(), is("retrieve media"));

        //action headers
        assertThat(action.getHeaders().size(), is(1));
        Header apiKeyHeader = action.getHeaders().get("api-key");
        assertThat(apiKeyHeader.getDisplayName(), is("Api key"));
        assertThat(apiKeyHeader.getDescription(), is("Api key description"));
        assertThat(apiKeyHeader.getType(), is(STRING));
        assertThat(apiKeyHeader.isRequired(), is(true));
        assertThat(apiKeyHeader.getMinLength(), is(10));
        assertThat(apiKeyHeader.getMaxLength(), is(10));
        assertThat(apiKeyHeader.getExample(), is("0123456789"));

        //action query parameters
        assertThat(action.getQueryParameters().size(), is(1));
        QueryParameter pageQueryParam = action.getQueryParameters().get("page");
        assertThat(pageQueryParam.getType(), is(INTEGER));
View Full Code Here

TOP

Related Classes of org.raml.model.parameter.Header

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.