createClientProxyFactory(ADMIN, ADMIN_KEY);
UnimplementedIAccountResource accountClient =
super.createProxy(proxyFactory,
UnimplementedIAccountResource.class,
"/accounts/u/sampleaccount");
IAccountResource originalAccountClient =
super.createProxy(proxyFactory, IAccountResource.class,
"/accounts/u/sampleaccount");
ClientResponse putResponse = accountClient.putJson(a);
// Assert initial put
assertThat(putResponse.getStatus(), is(Status.CREATED.getStatusCode()));
putResponse.releaseConnection();
// Modified Account
a.setName("New Account Name");
putResponse = accountClient.putJson(a);
putResponse.releaseConnection();
// Assert modification
assertThat(putResponse.getStatus(), is(Status.OK.getStatusCode()));
// Retrieve again
Account a2 = originalAccountClient.get().getEntity();
assertThat(a2.getUsername(), is(a.getUsername()));
assertThat(a2.getApiKey(), is(a.getApiKey()));
assertThat(a2.getEmail(), is(a.getEmail()));
assertThat(a2.getName(), is(a.getName()));
assertThat(a2.getPasswordHash(), is(a.getPasswordHash()));