Package org.cedj.geekseek.web.rest.user.test.model

Examples of org.cedj.geekseek.web.rest.user.test.model.UserType


            .setBio("Bio");
    }

    @Override
    protected UserType createUpdateRepresentation() {
        return new UserType()
            .setName("Name 2")
            .setBio("Bio 2");
    }
View Full Code Here


    @Test @InSequence(1)
    public void shouldBeAbleToCreateUser() throws Exception {
        // User is not a top level resource, so in the test we hardcode the known location
        uri_user = new URL(base, "api/user").toExternalForm();

        UserType conf = getCreateUser();

        uri_userInstance =
              given().
                  contentType(USER_MEDIA_TYPE).
                  body(conf).
View Full Code Here

    @Test @InSequence(3)
    public void shouldBeAbleToUpdateUser() throws Exception {
        assertNotNull("Previous step failed", uri_userInstance);

        UserType conf = getUpdateUser();

        given().
            contentType(USER_MEDIA_TYPE).
            body(conf).
        then().
View Full Code Here

    @Test @InSequence(4)
    public void verifyUpdatedUser() throws Exception {
        assertNotNull("Previous step failed", uri_userInstance);

        UserType conf = getUpdateUser();

        given().
        then().
           contentType(USER_MEDIA_TYPE).
           statusCode(Status.OK.getStatusCode()).
           root("user").
               body("name", equalTo(conf.getName())).
               body("bio", equalTo(conf.getBio())).
               body("handle", not(equalTo(conf.getHandle()))). // handle is the id, can not be updated
        when().
           get(uri_userInstance);
    }
View Full Code Here

        when().
           get(uri_userInstance);
    }

    private UserType getCreateUser() throws Exception {
        UserType user = new UserType()
                                .setHandle("Handle")
                                .setName("Name")
                                .setBio("Bio");
        return user;
    }
View Full Code Here

                                .setBio("Bio");
        return user;
    }

    private UserType getUpdateUser() throws Exception {
        UserType user = new UserType()
                                .setHandle("Handle 2")
                                .setName("Name 2")
                                .setBio("Bio 2");
        return user;
    }
View Full Code Here

TOP

Related Classes of org.cedj.geekseek.web.rest.user.test.model.UserType

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.