Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mfriesen committed Jul 4, 2024
1 parent ce483ae commit d78a672
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ Resources:
- Effect: Allow
Action:
- cognito-idp:ListGroups
- cognito-idp:ListUsers
- cognito-idp:ListUsersInGroup
- cognito-idp:CreateGroup
- cognito-idp:DeleteGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import com.formkiq.client.model.AddUser;
import com.formkiq.client.model.AddUserRequest;
import com.formkiq.client.model.DeleteResponse;
import com.formkiq.client.model.GetUsersResponse;
import com.formkiq.client.model.SetResponse;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
Expand Down Expand Up @@ -97,6 +98,37 @@ private static void addUser(final UserManagementApi userApi, final String email)
assertEquals("user '" + email + "' has been created", response.getMessage());
}

/**
* Test GET /users.
*
* @throws Exception Exception
*/
@Test
@Timeout(value = TEST_TIMEOUT)
public void testGetUsers01() throws Exception {

// given
List<ApiClient> clients = getApiClients(null);

for (ApiClient client : clients) {

UserManagementApi userApi = new UserManagementApi(client);

// when
GetUsersResponse response = userApi.getUsers(null, null);

// then
List<User> users = notNull(response.getUsers());
assertFalse(users.isEmpty());

User user = users.get(0);
assertNotNull(user.getUsername());
assertNotNull(user.getUserStatus());
assertNotNull(user.getInsertedDate());
assertNotNull(user.getLastModifiedDate());
}
}

/**
* Test GET /groups.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import java.util.List;
import java.util.UUID;

import com.formkiq.client.model.AddApiKeyRequest;
import com.formkiq.client.model.AddApiKeyResponse;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
Expand Down Expand Up @@ -104,17 +106,18 @@ public void testApiKey01() throws Exception {
UUID.randomUUID().toString())) {

for (ApiClient client : Arrays.asList(apiClients.get(0), apiClients.get(1))) {
com.formkiq.client.model.AddApiKeyRequest apiReq =
new com.formkiq.client.model.AddApiKeyRequest().name(name);
AddApiKeyRequest apiReq = new AddApiKeyRequest().name(name);

SystemManagementApi api = new SystemManagementApi(client);

// when
api.addApiKey(siteId, apiReq);
AddApiKeyResponse response = api.addApiKey(siteId, apiReq);

// then
GetApiKeysResponse apiKeys = api.getApiKeys(siteId);
assertFalse(notNull(apiKeys.getApiKeys()).isEmpty());

api.deleteApiKey(siteId, response.getApiKey());
}
}

Expand Down

0 comments on commit d78a672

Please sign in to comment.