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

    https://github.com/apache/incubator-usergrid/pull/114#discussion_r21175283
  
    --- Diff: 
stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
 ---
    @@ -68,22 +73,82 @@
     
         private static Logger log = LoggerFactory.getLogger( 
UserResourceIT.class );
     
    +    @Rule
    +    public TestContextSetup context = new TestContextSetup( this );
    +
    +    @Test
    +    public void usernameQueryApiResource() throws IOException {
    +
    +        String username = "usernameQuery";
    +        String password = "password";
    +        String email = username + "@usergrid.com";
    +        String token = context.getActiveUser().getToken();
    +
    +        //        TestUser testUser = new TestAppUser( username, password, 
email );
    +        //
    +        //        context.withUser( testUser );
    +        //
    +        //        refreshIndex( context.getOrgName(), context.getAppName() 
);
    +        //
    +        String ql = "username = '"+context.getActiveUser().getUser()+"'";
    +
    +
    +        JsonNode node1 = mapper.readTree( resource().path( 
"/"+context.getOrgName()+"/"+context.getAppName()+"/users" ).queryParam( "ql", 
ql )
    +                                                   .queryParam( 
"access_token", context.getActiveUser().getToken() ).accept(
    +                        MediaType.APPLICATION_JSON )
    +                                                   .type( 
MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
    +        //JsonNode node = context.collection( "users" ).query( 
ql,null,null ).;
    +        RevisedApiResponse node = null;
    +
    +        try {
    +            node = resource().path( 
"/"+context.getOrgName()+"/"+context.getAppName()+"/users" ).queryParam( "ql", 
ql )
    +                                                .queryParam( 
"access_token",
    +                                                        
context.getActiveUser().getToken() ).accept(
    +                            MediaType.APPLICATION_JSON )
    +                                                .type( 
MediaType.APPLICATION_JSON_TYPE ).get( RevisedApiResponse.class );
    +        }catch(Exception e){
    +            e.printStackTrace();
    +            fail();
    +        }
    +
    +        assertNotNull( node );
    +
    +//        assertEquals( UserRepo.INSTANCE.getByUserName( "unq_user1" ), 
getIdFromSearchResults( node, 0 ) );
    +//        assertEquals( UserRepo.INSTANCE.getByUserName( "unq_user2" ), 
getIdFromSearchResults( node, 1 ) );
    +//        assertEquals( UserRepo.INSTANCE.getByUserName( "unq_user3" ), 
getIdFromSearchResults( node, 2 ) );
    +    }
    +
     
         @Test
         public void usernameQuery() throws IOException {
    --- End diff --
    
    This test has no comment and needs to be fixed/changed  so that it does its 
original user checking. 


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to