Search in sources :

Example 1 with UserDTOResponse

use of org.geosdi.geoplatform.response.UserDTOResponse in project geo-platform by geosdi.

the class RSAccountTest method testRetrieveUserRest.

@Test
public void testRetrieveUserRest() throws ResourceNotFoundFault {
    // Number of Account Like
    long numAccountsLike = gpWSClient.getAccountsCount(new SearchRequest(usernameTest, LikePatternType.CONTENT_EQUALS));
    Assert.assertEquals("Number of Account Like", 1L, numAccountsLike);
    // Get User from Id
    // Get UserDTO from Id
    UserDTOResponse userDTOResponse = gpWSClient.getShortUser(idUserTest);
    UserDTO userDTOFromWS = userDTOResponse.getUserDTO();
    Assert.assertNotNull(userDTOFromWS);
    Assert.assertEquals("Error found UserDTO from Id", idUserTest, userDTOFromWS.getId().longValue());
    // Get GPUser from Id
    GPUser userFromWS = gpWSClient.getUserDetail(idUserTest);
    Assert.assertNotNull(userFromWS);
    Assert.assertEquals("Error found GPUser from Id", idUserTest, userFromWS.getId().longValue());
    // Get User from Username
    // Get UserDTO from Username
    userDTOFromWS = gpWSClient.getShortUserByUsername(new SearchRequest(usernameTest, LikePatternType.CONTENT_EQUALS)).getUserDTO();
    Assert.assertNotNull(userDTOFromWS);
    Assert.assertEquals("Error found UserDTO from Username", idUserTest, userDTOFromWS.getId().longValue());
    // Get GPUser from Username
    userFromWS = gpWSClient.getUserDetailByUsername(new SearchRequest(usernameTest, LikePatternType.CONTENT_EQUALS));
    Assert.assertNotNull(userFromWS);
    Assert.assertEquals("Error found GPUser from Username", idUserTest, userFromWS.getId().longValue());
}
Also used : SearchRequest(org.geosdi.geoplatform.request.SearchRequest) PaginatedSearchRequest(org.geosdi.geoplatform.request.PaginatedSearchRequest) GPUser(org.geosdi.geoplatform.core.model.GPUser) UserDTOResponse(org.geosdi.geoplatform.response.UserDTOResponse) UserDTO(org.geosdi.geoplatform.response.UserDTO) Test(org.junit.Test)

Example 2 with UserDTOResponse

use of org.geosdi.geoplatform.response.UserDTOResponse in project geo-platform by geosdi.

the class WSAccountTest method testRetrieveUser.

@Test
public void testRetrieveUser() throws ResourceNotFoundFault {
    // Number of Account Like
    long numAccountsLike = gpWSClient.getAccountsCount(new SearchRequest(usernameTest, LikePatternType.CONTENT_EQUALS));
    assertEquals("Number of Account Like", 1L, numAccountsLike);
    // Get User from Id
    // Get UserDTO from Id
    UserDTOResponse userDTOResponse = gpWSClient.getShortUser(idUserTest);
    UserDTO userDTOFromWS = userDTOResponse.getUserDTO();
    assertNotNull(userDTOFromWS);
    assertEquals("Error found UserDTO from Id", idUserTest, userDTOFromWS.getId().longValue());
    // Get GPUser from Id
    GPUser userFromWS = gpWSClient.getUserDetail(idUserTest);
    assertNotNull(userFromWS);
    assertEquals("Error found GPUser from Id", idUserTest, userFromWS.getId().longValue());
    // Get User from Username
    // Get UserDTO from Username
    userDTOFromWS = gpWSClient.getShortUserByUsername(new SearchRequest(usernameTest, LikePatternType.CONTENT_EQUALS)).getUserDTO();
    assertNotNull(userDTOFromWS);
    assertEquals("Error found UserDTO from Username", idUserTest, userDTOFromWS.getId().longValue());
    // Get GPUser from Username
    userFromWS = gpWSClient.getUserDetailByUsername(new SearchRequest(usernameTest, LikePatternType.CONTENT_EQUALS));
    assertNotNull(userFromWS);
    assertEquals("Error found GPUser from Username", idUserTest, userFromWS.getId().longValue());
}
Also used : SearchRequest(org.geosdi.geoplatform.request.SearchRequest) PaginatedSearchRequest(org.geosdi.geoplatform.request.PaginatedSearchRequest) GPUser(org.geosdi.geoplatform.core.model.GPUser) UserDTOResponse(org.geosdi.geoplatform.response.UserDTOResponse) UserDTO(org.geosdi.geoplatform.response.UserDTO) Test(org.junit.Test)

Aggregations

GPUser (org.geosdi.geoplatform.core.model.GPUser)2 PaginatedSearchRequest (org.geosdi.geoplatform.request.PaginatedSearchRequest)2 SearchRequest (org.geosdi.geoplatform.request.SearchRequest)2 UserDTO (org.geosdi.geoplatform.response.UserDTO)2 UserDTOResponse (org.geosdi.geoplatform.response.UserDTOResponse)2 Test (org.junit.Test)2