|
70 | 70 | -export([batch_commit_ok/1]). |
71 | 71 | -export([batch_rollback_ok/1]). |
72 | 72 | -export([batch_rollback_lenient_to_config_notfound_ok/1]). |
73 | | --export([batch_get_values_lenient_to_config_notfound_ok/1]). |
74 | | --export([batch_hold_strict_to_config_notfound_ok/1]). |
75 | 73 | -export([two_batch_hold_ok/1]). |
76 | 74 | -export([two_batch_commit_ok/1]). |
77 | 75 | -export([two_batch_rollback_ok/1]). |
@@ -142,8 +140,6 @@ groups() -> |
142 | 140 | batch_commit_ok, |
143 | 141 | batch_rollback_ok, |
144 | 142 | batch_rollback_lenient_to_config_notfound_ok, |
145 | | - batch_get_values_lenient_to_config_notfound_ok, |
146 | | - batch_hold_strict_to_config_notfound_ok, |
147 | 143 | two_batch_hold_ok, |
148 | 144 | two_batch_commit_ok, |
149 | 145 | two_batch_rollback_ok, |
@@ -883,10 +879,6 @@ construct_request(C) -> |
883 | 879 | ?LIMIT_CHANGE(ID2, 0, Version2) |
884 | 880 | ]). |
885 | 881 |
|
886 | | -add_non_existent_limit_config(?LIMIT_REQUEST(_ID, Changes) = Request) -> |
887 | | - NonexistentChange = ?LIMIT_CHANGE(<<"this-does-not-exist">>, 0, dmt_client:get_last_version()), |
888 | | - Request#limiter_LimitRequest{limit_changes = [NonexistentChange | Changes]}. |
889 | | - |
890 | 882 | -spec batch_hold_ok(config()) -> _. |
891 | 883 | batch_hold_ok(C) -> |
892 | 884 | Context = |
@@ -930,37 +922,15 @@ batch_rollback_lenient_to_config_notfound_ok(C) -> |
930 | 922 | end, |
931 | 923 | Request0 = construct_request(C), |
932 | 924 | ok = hold_and_assert_batch(10, Request0, Context, C), |
933 | | - Request1 = add_non_existent_limit_config(Request0), |
| 925 | + Request1 = Request0#limiter_LimitRequest{ |
| 926 | + limit_changes = [ |
| 927 | + ?LIMIT_CHANGE(<<"this-does-not-exist">>, 0, dmt_client:get_last_version()) |
| 928 | + | Request0#limiter_LimitRequest.limit_changes |
| 929 | + ] |
| 930 | + }, |
934 | 931 | {ok, ok} = lim_client:rollback_batch(Request1, Context, ?config(client, C)), |
935 | 932 | ok = assert_values(0, Request0, Context, C). |
936 | 933 |
|
937 | | --spec batch_get_values_lenient_to_config_notfound_ok(config()) -> _. |
938 | | -batch_get_values_lenient_to_config_notfound_ok(C) -> |
939 | | - Context = |
940 | | - case get_group_name(C) of |
941 | | - withdrawals -> ?wthdproc_ctx_withdrawal(?cash(10)); |
942 | | - _Default -> ?payproc_ctx_payment(?cash(10), ?cash(10)) |
943 | | - end, |
944 | | - Request0 = construct_request(C), |
945 | | - ok = hold_and_assert_batch(10, Request0, Context, C), |
946 | | - Request1 = add_non_existent_limit_config(Request0), |
947 | | - ok = assert_batch(10, Request1, Context, C), |
948 | | - ok = assert_values(10, Request1, Context, C). |
949 | | - |
950 | | --spec batch_hold_strict_to_config_notfound_ok(config()) -> _. |
951 | | -batch_hold_strict_to_config_notfound_ok(C) -> |
952 | | - Context = |
953 | | - case get_group_name(C) of |
954 | | - withdrawals -> ?wthdproc_ctx_withdrawal(?cash(10)); |
955 | | - _Default -> ?payproc_ctx_payment(?cash(10), ?cash(10)) |
956 | | - end, |
957 | | - Request0 = construct_request(C), |
958 | | - Request1 = add_non_existent_limit_config(Request0), |
959 | | - ?assertEqual( |
960 | | - {exception, #limiter_LimitNotFound{}}, |
961 | | - lim_client:hold_batch(Request1, Context, ?config(client, C)) |
962 | | - ). |
963 | | - |
964 | 934 | -spec two_batch_hold_ok(config()) -> _. |
965 | 935 | two_batch_hold_ok(C) -> |
966 | 936 | Context = |
|
0 commit comments