Package com.example.tutorial.AddressBookProtos

Examples of com.example.tutorial.AddressBookProtos.Person.toByteArray()


    public void testPostPerson() throws Exception {
        MockHttpServletRequest request =
            MockRequestConstructor.constructMockRequest("POST", "/test/person", "application/x-protobuf");
        request.setContentType("application/x-protobuf");
        Person p = createPerson();
        request.setContent(p.toByteArray());
        MockHttpServletResponse response = invoke(request);
        assertEquals(200, response.getStatus());
        byte[] data = response.getContentAsByteArray();
        Person p1 = Person.parseFrom(data);
        assertEquals(p1);
View Full Code Here


    public void testPostPerson() throws Exception {
        MockHttpServletRequest request =
            MockRequestConstructor.constructMockRequest("POST", "/test/person", "application/x-protobuf");
        request.setContentType("application/x-protobuf");
        Person p = createPerson();
        request.setContent(p.toByteArray());
        MockHttpServletResponse response = invoke(request);
        assertEquals(200, response.getStatus());
        byte[] data = response.getContentAsByteArray();
        Person p1 = Person.parseFrom(data);
        assertEquals(p1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.