    @Test
    public void testListAccounts() {

        // arrange mock
        when(mailClient.send(any(EmailRequest.class))).thenReturn(BaseResponse.builder().message("email sent").build());

        // first account
        String name = "testAccount001";
        String email = "test001@staffjoy.xyz";
        String phoneNumber = "18001801236";
        String subject = "Activate your Staffjoy account";
        CreateAccountRequest createAccountRequest = CreateAccountRequest.builder()
                .name(name)
                .email(email)
                .phoneNumber(phoneNumber)
                .build();
        // create account
        GenericAccountResponse genericAccountResponse = accountClient.createAccount(AuthConstant.AUTHORIZATION_WWW_SERVICE, createAccountRequest);
        assertThat(genericAccountResponse.isSuccess()).isTrue();

        // list account and verify
        ListAccountResponse listAccountResponse = accountClient.listAccounts(AuthConstant.AUTHORIZATION_SUPPORT_USER, 0, 2);
        log.info((listAccountResponse.toString()));
        assertThat(genericAccountResponse.isSuccess()).isTrue();
        AccountList accountList = listAccountResponse.getAccountList();
        assertThat(accountList.getAccounts()).hasSize(1);
        assertThat(accountList.getLimit()).isEqualTo(2);
        assertThat(accountList.getOffset()).isEqualTo(0);

        // second account
        name = "testAccount002";
        email = "test002@staffjoy.xyz";
        phoneNumber = "18001801237";
        createAccountRequest = CreateAccountRequest.builder()
                .name(name)
                .email(email)
                .phoneNumber(phoneNumber)
                .build();
        // create account
        genericAccountResponse = accountClient.createAccount(AuthConstant.AUTHORIZATION_WWW_SERVICE, createAccountRequest);
        assertThat(genericAccountResponse.isSuccess()).isTrue();

        // list and verify
        listAccountResponse = accountClient.listAccounts(AuthConstant.AUTHORIZATION_SUPPORT_USER, 0, 2);
        log.info(listAccountResponse.toString());
        assertThat(genericAccountResponse.isSuccess()).isTrue();
        accountList = listAccountResponse.getAccountList();
        assertThat(accountList.getAccounts()).hasSize(2);
        assertThat(accountList.getLimit()).isEqualTo(2);
        assertThat(accountList.getOffset()).isEqualTo(0);

        // third account
        name = "testAccount003";
        email = "test003@staffjoy.xyz";
        phoneNumber = "18001801238";
        createAccountRequest = CreateAccountRequest.builder()
                .name(name)
                .email(email)
                .phoneNumber(phoneNumber)
                .build();
        // create account
        genericAccountResponse = accountClient.createAccount(AuthConstant.AUTHORIZATION_WWW_SERVICE, createAccountRequest);
        assertThat(genericAccountResponse.isSuccess()).isTrue();

        // list and verify
        listAccountResponse = accountClient.listAccounts(AuthConstant.AUTHORIZATION_SUPPORT_USER, 1, 2);
        log.info(listAccountResponse.toString());
        assertThat(genericAccountResponse.isSuccess()).isTrue();
        accountList = listAccountResponse.getAccountList();
        assertThat(accountList.getAccounts()).hasSize(1);
        assertThat(accountList.getLimit()).isEqualTo(2);
        assertThat(accountList.getOffset()).isEqualTo(1);
    }