Package com.rallydev.rest.response

Examples of com.rallydev.rest.response.UpdateResponse


        JsonObject updatedDefect = new JsonObject();
        updatedDefect.addProperty("Name", "Foo");
        UpdateRequest request = new UpdateRequest("/defect/1234", updatedDefect);
        doReturn(new Gson().toJson(response)).when(api.client).doPost(request.toUrl(), request.getBody());
        UpdateResponse updateResponse = api.update(request);

        verify(api.client).doPost(request.toUrl(), request.getBody());
        Assert.assertTrue(updateResponse.wasSuccessful());
        JsonObject obj = updateResponse.getObject();
        assertEquals(obj.get("_ref").getAsString(), "/defect/1234");
    }
View Full Code Here


     * @param request the {@link UpdateRequest} specifying the object to be updated.
     * @return the resulting {@link UpdateResponse}
     * @throws IOException if an error occurs during the update.
     */
    public UpdateResponse update(UpdateRequest request) throws IOException {
        return new UpdateResponse(client.doPost(request.toUrl(), request.getBody()));
    }
View Full Code Here

            //Update defect
            System.out.println("\nUpdating defect state...");
            JsonObject updatedDefect = new JsonObject();
            updatedDefect.addProperty("State", "Fixed");
            UpdateRequest updateRequest = new UpdateRequest(ref, updatedDefect);
            UpdateResponse updateResponse = restApi.update(updateRequest);
            obj = updateResponse.getObject();
            System.out.println(String.format("Updated defect. State = %s", obj.get("State").getAsString()));

            //Delete defect
            System.out.println("\nDeleting defect...");
            DeleteRequest deleteRequest = new DeleteRequest(ref);
View Full Code Here

TOP

Related Classes of com.rallydev.rest.response.UpdateResponse

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.