@PostMapping("/register")
    public EmailRegisterResult registerEmail(@RequestBody @Valid EmailRegisterRequest request,
                                       @RequestHeader(MijnDigidSession.MIJN_DIGID_SESSION_HEADER) String mijnDigiDsessionId){
        MijnDigidSession mijnDigiDSession = retrieveMijnDigiDSession(mijnDigiDsessionId);

        return accountService.registerEmail(mijnDigiDSession.getAccountId(), request);
    }
@Test
    public void validEmailRegister() {
        EmailRegisterRequest request = new EmailRegisterRequest();
        request.setEmail("email");

        EmailRegisterResult result = new EmailRegisterResult();
        result.setStatus(Status.OK);
        result.setError("error");
        result.setEmailAddress("address");
        result.setMaxAmountEmails(3);

        when(accountService.registerEmail(anyLong(), any())).thenReturn(result);

        EmailRegisterResult registerResult = emailController.registerEmail(request, mijnDigiDSession.getId());

        assertEquals(Status.OK, registerResult.getStatus());
        assertEquals("error", registerResult.getError());
        assertEquals(3, registerResult.getMaxAmountEmails());
        assertEquals("address", registerResult.getEmailAddress());
    }