You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by GERey <gi...@git.apache.org> on 2015/01/05 18:31:32 UTC

[GitHub] incubator-usergrid pull request: Usergrid 291 user tests

Github user GERey commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/132#discussion_r22474969
  
    --- Diff: stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java ---
    @@ -956,356 +739,290 @@ public void test_PUT_password_fail() {
         public void test_GET_user_ok() throws InterruptedException, IOException {
     
             // TODO figure out what is being overridden? why 400?
    -        JsonNode node = mapper.readTree( resource().path( "/test-organization/test-app/users" )
    -                .queryParam( "access_token", access_token )
    -                .accept( MediaType.APPLICATION_JSON )
    -                .type( MediaType.APPLICATION_JSON_TYPE )
    -                .get( String.class ));
    -
    -        String uuid = node.get( "entities" ).get( 0 ).get( "uuid" ).textValue();
    -        String email = node.get( "entities" ).get( 0 ).get( "email" ).textValue();
    -
    -        node = mapper.readTree( resource().path( "/test-organization/test-app/users/" + uuid )
    -                .queryParam( "access_token", access_token )
    -                .accept( MediaType.APPLICATION_JSON )
    -                .type( MediaType.APPLICATION_JSON_TYPE )
    -                .get( String.class ));
    +        Collection users = usersResource.get();
    +
    +        String uuid =  users.getResponse().getEntities().get(0).getUuid().toString();
    +        String email = users.getResponse().getEntities().get( 0 ).get("email").toString();
    +
    +        Entity user = usersResource.entity(uuid).get();
             
    -        logNode( node );
    -        assertEquals( email, node.get( "entities" ).get( 0 ).get( "email" ).textValue() );
    +        assertEquals( email, user.get("email").toString() );
         }
     
     
         @Test
         public void test_PUT_password_ok() {
    --- End diff --
    
    I don't see there being any put calls being done for this test. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---