Skip to content

Commit

Permalink
catalog: add mail test, #TASK-6183
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed May 7, 2024
1 parent 7b655a7 commit 4451b13
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.opencb.opencga.core.models.sample.*;
import org.opencb.opencga.core.models.study.*;
import org.opencb.opencga.core.models.user.Account;
import org.opencb.opencga.core.models.user.AuthenticationResponse;
import org.opencb.opencga.core.models.user.User;
import org.opencb.opencga.core.response.OpenCGAResult;
import org.opencb.opencga.core.testclassification.duration.MediumTests;
Expand Down Expand Up @@ -276,6 +277,16 @@ private String getAdminToken() throws CatalogException, IOException {
return catalogManager.getUserManager().loginAsAdmin("admin").getToken();
}

@Test
public void createUserUsingMailAsId() throws CatalogException {
catalogManager.getUserManager().create(new User().setId("[email protected]").setName("Hello")
.setAccount(new Account().setType(Account.AccountType.GUEST)), TestParamConstants.PASSWORD, opencgaToken);
AuthenticationResponse login = catalogManager.getUserManager().login("[email protected]", TestParamConstants.PASSWORD);
assertNotNull(login);
User user = catalogManager.getUserManager().get("[email protected]", new QueryOptions(), login.getToken()).first();
assertEquals("[email protected]", user.getId());
}

@Test
public void getGroupsTest() throws CatalogException {
Group group = new Group("groupId", Arrays.asList("user2", "user3")).setSyncedFrom(new Group.Sync("ldap", "bio"));
Expand Down

0 comments on commit 4451b13

Please sign in to comment.