@Test public void testUpdateUser() throws Exception { final AuthIdentity authIdentity = new AuthIdentity("joe", "banan"); context.checking( new Expectations() { { oneOf(client).removeAllFilters(); oneOf(client).addFilter( with(equal(new BasicAuthFilter("admin", "lamepass")))); oneOf(client).resource( new URI("http: will(returnValue(resource)); oneOf(resource).accept(MediaType.APPLICATION_JSON_TYPE); oneOf(resource).put(with(anAuthIdentity(authIdentity))); } }); warpAutenticationManager.updateUser("joe", authIdentity); context.assertIsSatisfied(); }
public void updateUser( String currentUserName, AuthIdentity newUserCredentials) throws CommunicationException { AuthIdentity userCred = new AuthIdentity( currentUserName, newUserCredentials.getPassword()); try { WebResource webResource = createRequestResource( "users/" + currentUserName); webResource.put(userCred); } catch (UniformInterfaceException t) { throw new CommunicationException( "Exception when executing PUT user: " + newUserCredentials, t); } }
WarpAutenticationManager { public void updateUser( String currentUserName, AuthIdentity newUserCredentials) throws CommunicationException { AuthIdentity userCred = new AuthIdentity( currentUserName, newUserCredentials.getPassword()); try { WebResource webResource = createRequestResource( "users/" + currentUserName); webResource.put(userCred); } catch (UniformInterfaceException t) { throw new CommunicationException( "Exception when executing PUT user: " + newUserCredentials, t); } } }
WarpAutenticationManager { public void updateUser( String currentUserName, AuthIdentity newUserCredentials) throws CommunicationException { AuthIdentity userCred = new AuthIdentity( currentUserName, newUserCredentials.getPassword()); try { WebResource webResource = createRequestResource( "users/" + currentUserName); webResource.put(userCred); } catch (UniformInterfaceException t) { throw new CommunicationException( "Exception when executing PUT user: " + newUserCredentials, t); } } WarpAutenticationManager(
            Client jerseyClient, String warpServerAddr, String warpAdminUser,
            String warpAdminPassword); }
WarpAutenticationManager { public void updateUser( String currentUserName, AuthIdentity newUserCredentials) throws CommunicationException { AuthIdentity userCred = new AuthIdentity( currentUserName, newUserCredentials.getPassword()); try { WebResource webResource = createRequestResource( "users/" + currentUserName); webResource.put(userCred); } catch (UniformInterfaceException t) { throw new CommunicationException( "Exception when executing PUT user: " + newUserCredentials, t); } } WarpAutenticationManager(
            Client jerseyClient, String warpServerAddr, String warpAdminUser,
            String warpAdminPassword); AuthIdentity getUser(String userName); void removeUser(String userName); void createUser(AuthIdentity warpUserCredentials); void updateUser(
            String currentUserName,
            AuthIdentity newUserCredentials); }
WarpAutenticationManager { public void updateUser( String currentUserName, AuthIdentity newUserCredentials) throws CommunicationException { AuthIdentity userCred = new AuthIdentity( currentUserName, newUserCredentials.getPassword()); try { WebResource webResource = createRequestResource( "users/" + currentUserName); webResource.put(userCred); } catch (UniformInterfaceException t) { throw new CommunicationException( "Exception when executing PUT user: " + newUserCredentials, t); } } WarpAutenticationManager(
            Client jerseyClient, String warpServerAddr, String warpAdminUser,
            String warpAdminPassword); AuthIdentity getUser(String userName); void removeUser(String userName); void createUser(AuthIdentity warpUserCredentials); void updateUser(
            String currentUserName,
            AuthIdentity newUserCredentials);  }