public EmailRegisterResult registerEmail(long accountId, EmailRegisterRequest request) {
        Map<String, Object> resultMap = accountClient.registerEmail(accountId, request.getEmail());
        return objectMapper.convertValue(resultMap, EmailRegisterResult.class);
    }
@Test
    public void testRegisterEmail() {
        EmailRegisterRequest request = new EmailRegisterRequest();
        request.setEmail("address");

        Map<String, Object> result = Map.of(
                "status", "OK",
                "error", "custom error",
                "max_amount_emails", "5",
                "email_address", "address");

        when(accountClient.registerEmail(eq(1L), eq("address"))).thenReturn(result);

        EmailRegisterResult emailRegisterResult = accountService.registerEmail(1L, request);

        assertEquals(Status.OK, emailRegisterResult.getStatus());
        assertEquals("custom error", emailRegisterResult.getError());
        assertEquals(5, emailRegisterResult.getMaxAmountEmails());
        assertEquals("address", emailRegisterResult.getEmailAddress());
    }