Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix failing test for deactivate by id #7629 #7737

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions src/test/java/edu/harvard/iq/dataverse/api/DeactivateUsersIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,12 @@ public void testDeactivateUser() {

@Test
public void testDeactivateUserById() {

Response createSuperuser = UtilIT.createRandomUser();
createSuperuser.then().assertThat().statusCode(OK.getStatusCode());
String superuserUsername = UtilIT.getUsernameFromResponse(createSuperuser);
String superuserApiToken = UtilIT.getApiTokenFromResponse(createSuperuser);
Response toggleSuperuser = UtilIT.makeSuperUser(superuserUsername);
toggleSuperuser.then().assertThat()
.statusCode(OK.getStatusCode());


Response createUser = UtilIT.createRandomUser();
createUser.prettyPrint();
createUser.then().assertThat().statusCode(OK.getStatusCode());
String username = UtilIT.getUsernameFromResponse(createUser);
Long userId = JsonPath.from(createUser.body().asString()).getLong("data.user.id");
String apiToken = UtilIT.getApiTokenFromResponse(createUser);


Long userId = JsonPath.from(createUser.body().asString()).getLong("data.authenticatedUser.id");
Response deactivateUser = UtilIT.deactivateUser(userId);
deactivateUser.prettyPrint();
deactivateUser.then().assertThat().statusCode(OK.getStatusCode());
Expand Down