use of com.baeldung.petstore.client.model.User in project tutorials by eugenp.
the class UserApiTest method updateUserTest.
/**
* Updated user
*
* This can only be done by the logged in user.
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void updateUserTest() {
String username = null;
User body = null;
api.updateUser(username, body);
// TODO: test validations
}
use of com.baeldung.petstore.client.model.User in project tutorials by eugenp.
the class UserApi method getUserByName.
/**
* Get user by user name
*
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid username supplied
* <p><b>404</b> - User not found
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public User getUserByName(String username) throws RestClientException {
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling getUserByName");
}
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username);
String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
final String[] accepts = { "application/xml", "application/json" };
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] {};
ParameterizedTypeReference<User> returnType = new ParameterizedTypeReference<User>() {
};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
use of com.baeldung.petstore.client.model.User in project tutorials by eugenp.
the class UserApiTest method getUserByNameTest.
/**
* Get user by user name
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void getUserByNameTest() {
String username = null;
User response = api.getUserByName(username);
// TODO: test validations
}
use of com.baeldung.petstore.client.model.User in project tutorials by eugenp.
the class UserApiTest method createUserTest.
/**
* Create user
*
* This can only be done by the logged in user.
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void createUserTest() {
User body = null;
api.createUser(body);
// TODO: test validations
}
Aggregations