request.setName("my-test-client");
request.setDescription("test client created for unit tests");
request.setTier("UNLIMITED");
request.setCallbackUrl(null);
SingleClientResponse response = api.create(Settings.API_USERNAME, Settings.API_PASSWORD, request);
Client client = response.getResult();
Assert.assertNotNull(client, "No clients returned after creation");
SingleClientResponse clientResponse = api.getClientByName(Settings.API_USERNAME, Settings.API_PASSWORD, request.getName());
Assert.assertNotNull(clientResponse.getResult(), "Null client description returned for client " + request.getName());
api.delete(Settings.API_USERNAME, Settings.API_PASSWORD, request.getName());
clientResponse = api.getClientByName(Settings.API_USERNAME, Settings.API_PASSWORD, request.getName());
Assert.assertNull(clientResponse.getResult(), "Client description was returned for deleted client " + request.getName());
} catch (ApiException e) {
Assert.fail("Failed to query all apps", e);
}
}