=== Test case: rest_SUITE:user_can_be_registered_and_removed/1 (click for source code)

=== Config value:

    [{watchdog,<0.13879.1>},
     {{ejabberd_cwd,mongooseim@localhost},
      "/home/circleci/project/_build/mim1/rel/mongooseim"},
     {mam_backend,disabled},
     {mim_data_dir,"/home/circleci/project/big_tests/tests/rest_SUITE_data"},
     {preset,"ldap_mnesia"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@12130b74fc81.2022-03-03_10.28.39/big_tests.tests.rest_SUITE.logs/run.2022-03-03_10.38.08/rest_suite.user_can_be_registered_and_removed.51971.html"},
     {tc_group_properties,[{name,admin},parallel]},
     {tc_group_path,[]},
     {data_dir,"/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/rest_SUITE_data/"},
     {priv_dir,"/home/circleci/project/big_tests/ct_report/ct_run.test@12130b74fc81.2022-03-03_10.28.39/big_tests.tests.rest_SUITE.logs/run.2022-03-03_10.38.08/log_private/"},
     {escalus_users,[{alice,[{username,<<"alicE">>},
                             {server,<<"localhost">>},
                             {password,<<"matygrysa">>}]},
                     {bob,[{username,<<"bOb">>},
                           {server,<<"localhost">>},
                           {password,<<"makrolika">>}]}]}]

=== Current directory is "/home/circleci/project/big_tests/ct_report/ct_run.test@12130b74fc81.2022-03-03_10.28.39"

=== Started at 2022-03-03 10:38:08


*** CT 2022-03-03 10:38:08.227 *** View log from node mongooseim@localhost when started mongooseim@localhost_4901.html
*** CT 2022-03-03 10:38:08.228 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_2342.html

*** User 2022-03-03 10:38:08.250 ***
REST request:
Code: 200
Req: {<0.14024.1>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"4f7067890dada5d2">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"328">>}],
         <<"[\"alice@localhost\",\"alice_disco_features_960@localhost\",\"alice_disco_features_with_mam_961@localhost\",\"alice_disco_info_962@localhost\",\"alice_disco_info_with_mam_963@localhost\",\"alice_disco_service_959@localhost\",\"alice_messages_are_sent_and_received_1283@localhost\",\"alice_session_can_be_kicked_1282@localhost\",\"bob@localhost\"]">>,
         453,3907}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.254 ***
REST request:
Code: 201
Req: {<0.14038.1>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"8f867e1a36933371">>}],
      <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>}
Result: {{<<"201">>,<<"Created">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"location">>,
           <<"http://localhost:8088/api/users/localhost/User mike@localhost successfully registered">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"43">>}],
         <<"User mike@localhost successfully registered">>,269,2404}
Params: #{body => <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>,
          method => <<"POST">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.257 ***
REST request:
Code: 200
Req: {<0.14054.1>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"e43f94611ec8cd0b">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"593">>}],
         <<"[\"alice@localhost\",\"alice_disco_features_960@localhost\",\"alice_disco_features_with_mam_961@localhost\",\"alice_disco_info_962@localhost\",\"alice_disco_info_with_mam_963@localhost\",\"alice_disco_service_959@localhost\",\"alice_messages_are_sent_and_received_1283@localhost\",\"alice_messages_error_handling_1284@localhost\",\"alice_session_can_be_kicked_1282@localhost\",\"alice_stanzas_are_sent_and_received_1285@localhost\",\"bob@localhost\",\"bob_messages_are_sent_and_received_1283@localhost\",\"bob_messages_error_handling_1284@localhost\",\"bob_stanzas_are_sent_and_received_1285@localhost\",\"mike@localhost\"]">>,
         718,1923}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.260 ***
REST request fails:
Code: 403
Req: {<0.14073.1>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"78ef34f212efd7ea">>}],
      <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>}
Result: {{<<"403">>,<<"Forbidden">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"67">>}],
         <<"User mike@localhost already registered at node mongooseim@localhost">>,
         198,2087}
Params: #{body => <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>,
          method => <<"POST">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.263 ***
REST request:
Code: 204
Req: {<0.14084.1>,<<"/api/users/localhost/mike">>,<<"DELETE">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"9fba99cd4f5548da">>}],
      <<>>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,1846}
Params: #{body => <<>>,method => <<"DELETE">>,
          path => <<"/api/users/localhost/mike">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.266 ***
REST request:
Code: 200
Req: {<0.14097.1>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"8fd3e5ec1895f29a">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"576">>}],
         <<"[\"alice@localhost\",\"alice_disco_features_960@localhost\",\"alice_disco_features_with_mam_961@localhost\",\"alice_disco_info_962@localhost\",\"alice_disco_info_with_mam_963@localhost\",\"alice_disco_service_959@localhost\",\"alice_messages_are_sent_and_received_1283@localhost\",\"alice_messages_error_handling_1284@localhost\",\"alice_session_can_be_kicked_1282@localhost\",\"alice_stanzas_are_sent_and_received_1285@localhost\",\"bob@localhost\",\"bob_messages_are_sent_and_received_1283@localhost\",\"bob_messages_error_handling_1284@localhost\",\"bob_stanzas_are_sent_and_received_1285@localhost\"]">>,
         701,1630}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.268 ***
REST request fails:
Code: 400
Req: {<0.14108.1>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"0d428498a0be1cb3">>}],
      <<"{\"username\":\"m@ke\",\"password\":\"nicniema\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"26">>}],
         <<"Invalid JID m@ke@localhost">>,159,885}
Params: #{body => <<"{\"username\":\"m@ke\",\"password\":\"nicniema\"}">>,
          method => <<"POST">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-03-03 10:38:08.269 ***
REST request fails:
Code: 400
Req: {<0.14121.1>,<<"/api/users/localhost/@mike">>,<<"DELETE">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"f6bc89a0db0728c8">>}],
      <<>>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 03 Mar 2022 10:38:07 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"Invalid JID">>,144,729}
Params: #{body => <<>>,method => <<"DELETE">>,
          path => <<"/api/users/localhost/@mike">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-03-03 10:38:08.275 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_2342.html
*** CT 2022-03-03 10:38:08.276 *** View log from node mongooseim@localhost when finished mongooseim@localhost_4901.html



=== Ended at 2022-03-03 10:38:08
=== successfully completed test case
=== === Returned value: ok