You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2023/01/04 21:27:45 UTC

[couchdb] branch main updated: Add test coverage for replicator user_ctx parser

This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new f8d489f31 Add test coverage for replicator user_ctx parser
f8d489f31 is described below

commit f8d489f3185accb9acd4d732330d52d9d05bb19a
Author: Jay Doane <ja...@apache.org>
AuthorDate: Wed Jan 4 10:06:33 2023 -0800

    Add test coverage for replicator user_ctx parser
    
    This adds a test to cover the case when a replication doc contains a
    user_ctx, and subsequently executes `get_json_value/3`.
    
    See: https://github.com/apache/couchdb/pull/4343
---
 src/couch_replicator/src/couch_replicator_parse.erl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/couch_replicator/src/couch_replicator_parse.erl b/src/couch_replicator/src/couch_replicator_parse.erl
index 8cad4d9a3..e4c0c0211 100644
--- a/src/couch_replicator/src/couch_replicator_parse.erl
+++ b/src/couch_replicator/src/couch_replicator_parse.erl
@@ -583,6 +583,13 @@ check_convert_options_fail_test() ->
         convert_options([{<<"query_params">>, 42}])
     ).
 
+rep_user_ctx_test() ->
+    RepDoc = {[{<<"user_ctx">>, {[]}}]},
+    ?assertEqual(
+        #user_ctx{name = null, roles = [], handler = undefined},
+        rep_user_ctx(RepDoc)
+    ).
+
 local_replication_endpoint_error_test_() ->
     {
         foreach,