summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Doane <jaydoane@apache.org>2021-05-29 16:46:53 -0700
committerJay Doane <jay.s.doane@gmail.com>2021-06-02 12:04:07 -0700
commitf890da496f49172c520d3fa15e1507c5c640adef (patch)
tree334bd9279d5794f15f0701a55af4e305d5534075
parent6de915cf5dbeb78f60b919b60a67b463644e15d2 (diff)
downloadcouchdb-f890da496f49172c520d3fa15e1507c5c640adef.tar.gz
Fix get_db_info aegis server test for operational key manager
When aegis is configured to use an operational key manager, the get_db_info test can fail since the `passthrough` option is used, but `get_db_info/1` doesn't get mocked, resulting in the operational key manager's implementation unintentially being used in the test. This replaces the `passthrough` option with `non_strict`, and mocks `get_db_info/1` so that the same mocked functions are used in tests regardless of whether `AEGIS_KEY_MANAGER` is `aegis_noop_key_manager`, or an operational key manager.
-rw-r--r--src/aegis/test/aegis_server_test.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/aegis/test/aegis_server_test.erl b/src/aegis/test/aegis_server_test.erl
index ff16475b4..281dce59d 100644
--- a/src/aegis/test/aegis_server_test.erl
+++ b/src/aegis/test/aegis_server_test.erl
@@ -51,9 +51,10 @@ basic_test_() ->
setup() ->
Ctx = test_util:start_couch([fabric]),
- meck:new([?AEGIS_KEY_MANAGER], [passthrough]),
+ meck:new([?AEGIS_KEY_MANAGER], [non_strict]),
ok = meck:expect(?AEGIS_KEY_MANAGER, init_db, 2, {ok, <<0:256>>}),
ok = meck:expect(?AEGIS_KEY_MANAGER, open_db, 1, {ok, <<0:256>>}),
+ ok = meck:expect(?AEGIS_KEY_MANAGER, get_db_info, 1, []),
Ctx.