@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 validTwoFactorChange() {
        DTwoFactorChangeRequest request = new DTwoFactorChangeRequest();
        request.setAppSessionId("id");
        request.setSettingTwoFactor(false);

        AccountResult result = new TwoFactorStatusResult();
        result.setStatus(Status.OK);
        result.setError("error");

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

        AccountResult accountResult = twoFactorController.changeTwoFactor(request);

        assertEquals(Status.OK, accountResult.getStatus());
        assertEquals("error", accountResult.getError());
    }