Package org.zanata.rest

Examples of org.zanata.rest.ResourceRequest


    @RunAsClient
    public void putJsonProjectIteration() throws Exception {
        final ProjectIteration newIteration =
                new ProjectIteration("new-iteration");

        new ResourceRequest(
                getRestEndpointUrl("/projects/p/sample-project/iterations/i/"
                        + newIteration.getId()), "PUT",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
View Full Code Here


    }

    @Test
    @RunAsClient
    public void xmlGet() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/glossary"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML);
            }
View Full Code Here

    }

    @Test
    @RunAsClient
    public void jsonGet() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/glossary"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON);
            }
View Full Code Here

    }

    @Test
    @RunAsClient
    public void unauthorizedDelete() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/glossary"), "DELETE") {
            @Override
            protected void prepareRequest(ClientRequest request) {
            }

            @Override
View Full Code Here

    @Test
    @RunAsClient
    public void putXml() throws Exception {
        final Glossary glossary = this.getSampleGlossary();

        new ResourceRequest(getRestEndpointUrl("/glossary"), "PUT",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.body(MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML,
                        jaxbMarhsal(glossary).getBytes());
View Full Code Here

     */

    @Test
    @RunAsClient
    public void delete() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/glossary"), "DELETE",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
            }

View Full Code Here

    }

    @Test
    @RunAsClient
    public void xmlGetUnavailable() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/NOT_AVAILABLE"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_ACCOUNT_XML);
            }
View Full Code Here

    }

    @Test
    @RunAsClient
    public void xmlGet() throws Exception {
        new ResourceRequest(getRestEndpointUrl("accounts/u/admin"), "GET",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_ACCOUNT_XML);
View Full Code Here

    }

    @Test
    @RunAsClient
    public void jsonGet() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/accounts/u/admin"), "GET",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_ACCOUNT_JSON);
View Full Code Here

        final Account account =
                new Account("test@testing.com", "Test Account", "testuser",
                        "Eyox7xbNQ09MkIfRyH+rjg==");
        account.setEnabled(false);

        new ResourceRequest(getRestEndpointUrl("/accounts/u/testuser"), "PUT",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.body(MediaTypes.APPLICATION_ZANATA_ACCOUNT_XML,
                        jaxbMarhsal(account).getBytes());
View Full Code Here

TOP

Related Classes of org.zanata.rest.ResourceRequest

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.