user unlock action (pseudo-impl only)

This commit is contained in:
danikov 2012-03-12 11:41:05 +00:00
parent 1309d803e8
commit e94b719347
3 changed files with 30 additions and 4 deletions

View File

@ -88,5 +88,13 @@ public interface UserAsyncClient {
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> deleteUser(@EndpointParam URI userRef); ListenableFuture<Void> deleteUser(@EndpointParam URI userRef);
// POST /admin/user/{id}/action/unlock /**
* @see UserClient#unlockUser(URI)
*/
@POST
@Path("/action/unlock")
@Consumes
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> unlockUser(@EndpointParam URI userRef);
} }

View File

@ -79,5 +79,12 @@ public interface UserClient {
*/ */
void deleteUser(URI userRef); void deleteUser(URI userRef);
// POST /admin/user/{id}/action/unlock /**
* Unlocks a user.
*
* <pre>
* POST /admin/user/{id}/action/unlock
* </pre>
*/
void unlockUser(URI userRef);
} }

View File

@ -162,10 +162,21 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest {
} }
} }
// POST /admin/user/{id}/action/unlock //
@Test(testName = "POST /admin/user/{id}/action/unlock",
dependsOnMethods = { "testUpdateUser" } )
public void testUnlockUser() {
//TODO: check previous tests a) enabled lockout, b) set password
//TODO: attempt too many times with the wrong password
//TODO: verify access is denied
//TODO: unlock user
//TODO: verify access is renewed
}
@Test(testName = "DELETE /admin/user/{id}", @Test(testName = "DELETE /admin/user/{id}",
dependsOnMethods = { "testUpdateUser" } ) dependsOnMethods = { "testUnlockUser" } )
public void testDeleteUser() { public void testDeleteUser() {
userClient.deleteUser(user.getHref()); userClient.deleteUser(user.getHref());