@PostMapping("/change_two_factor")
    @Operation(summary = "Set the two factor setting of an account")
    public AccountResult changeTwoFactor(@RequestBody DTwoFactorChangeRequest deprecatedRequest) {
        validateSettingTwoFactor(deprecatedRequest);
        AppSession appSession = validate(deprecatedRequest);

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

        return result;
    }
@Test
    public void invalidSettingTwoFactor() {
        DTwoFactorChangeRequest request = new DTwoFactorChangeRequest();
        request.setAppSessionId("id");

        DAccountException exc = assertThrows(DAccountException.class, () -> {
            twoFactorController.changeTwoFactor(request);
        });

        assertEquals(HttpStatus.BAD_REQUEST, exc.getAccountErrorMessage().getHttpStatus());
        assertEquals("Missing parameters.", exc.getAccountErrorMessage().getMessage());
    }