@PostMapping("/register")
    @Operation(summary = "Register an email to an account, email needs to be verified to become active")
    public DEmailRegisterResult registerEmail(@RequestBody DEmailRegisterRequest deprecatedRequest) {
        AppSession appSession = validate(deprecatedRequest);

        var request = deprecatedRequest.getRequest();
        var result = accountService.registerEmail(appSession.getAccountId(), request);

        return DEmailRegisterResult.copyFrom(result);
    }
@Test
    public void invalidEmailRegister() {
        DEmailRegisterRequest request = new DEmailRegisterRequest();
        request.setAppSessionId("id");

        EmailRegisterResult result = new EmailRegisterResult();
        result.setStatus(Status.OK);

        when(accountService.registerEmail(eq(1L), any())).thenReturn(result);

        DEmailRegisterResult registerResult = emailController.registerEmail(request);

        assertEquals(Status.OK, registerResult.getStatus());
    }