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

=== Config value:

    [{watchdog,<0.7719.2>},
     {{ejabberd_cwd,mongooseim@localhost},
      "/home/circleci/project/_build/mim1/rel/mongooseim"},
     {mam_backend,rdbms},
     {mim_data_dir,"/home/circleci/project/big_tests/tests/rest_SUITE_data"},
     {preset,"odbc_mssql_mnesia"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@ebe8a8f9fc53.2022-01-25_16.21.59/big_tests.tests.rest_SUITE.logs/run.2022-01-25_16.34.19/rest_suite.messages_error_handling.118147.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@ebe8a8f9fc53.2022-01-25_16.21.59/big_tests.tests.rest_SUITE.logs/run.2022-01-25_16.34.19/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@ebe8a8f9fc53.2022-01-25_16.21.59"

=== Started at 2022-01-25 16:34:20


*** CT 2022-01-25 16:34:20.051 *** View log from node mongooseim@localhost when started mongooseim@localhost_5707.html
*** CT 2022-01-25 16:34:20.051 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_2377.html

*** User 2022-01-25 16:34:20.077 ***
alicE_messages_error_handling_2209@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-01-25 16:34:20.078 ***
alicE_messages_error_handling_2209@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='9269adf5ac6596bb' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-25 16:34:20.078 ***
alicE_messages_error_handling_2209@localhost/res1 in
<stream:features>
	<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
		<mechanism>SCRAM-SHA-256</mechanism>
		<mechanism>PLAIN</mechanism>
	</mechanisms>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-01-25 16:34:20.078 ***
alicE_messages_error_handling_2209@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFsaWNFX21lc3NhZ2VzX2Vycm9yX2hhbmRsaW5nXzIyMDkAbWF0eWdyeXNh</auth>



*** User 2022-01-25 16:34:20.079 ***
alicE_messages_error_handling_2209@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-25 16:34:20.079 ***
alicE_messages_error_handling_2209@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-01-25 16:34:20.080 ***
alicE_messages_error_handling_2209@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='7ecc6e3254ccdaad' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-25 16:34:20.080 ***
alicE_messages_error_handling_2209@localhost/res1 in
<stream:features>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-01-25 16:34:20.080 ***
alicE_messages_error_handling_2209@localhost/res1 out
<iq type='set' id='a4e637d98f588e49dcff5be38e2249f6'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.080 ***
alicE_messages_error_handling_2209@localhost/res1 in
<iq id='a4e637d98f588e49dcff5be38e2249f6' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>alicE_messages_error_handling_2209@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.082 ***
alicE_messages_error_handling_2209@localhost/res1 out
<iq type='set' id='d0d51bfa4d9a0a458968ba0d3bfda061'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.082 ***
alicE_messages_error_handling_2209@localhost/res1 in
<iq type='result' id='d0d51bfa4d9a0a458968ba0d3bfda061'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.082 ***
alicE_messages_error_handling_2209@localhost/res1 out
<presence/>



*** User 2022-01-25 16:34:20.085 ***
alicE_messages_error_handling_2209@localhost/res1 in
<presence from='alicE_messages_error_handling_2209@localhost/res1' to='alice_messages_error_handling_2209@localhost/res1' xml:lang='en'/>



*** User 2022-01-25 16:34:20.086 ***
bOb_messages_error_handling_2209@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-01-25 16:34:20.086 ***
bOb_messages_error_handling_2209@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='c1660a36002ffc69' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-25 16:34:20.086 ***
bOb_messages_error_handling_2209@localhost/res1 in
<stream:features>
	<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
		<mechanism>SCRAM-SHA-256</mechanism>
		<mechanism>PLAIN</mechanism>
	</mechanisms>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-01-25 16:34:20.087 ***
bOb_messages_error_handling_2209@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYl9tZXNzYWdlc19lcnJvcl9oYW5kbGluZ18yMjA5AG1ha3JvbGlrYQ==</auth>



*** User 2022-01-25 16:34:20.131 ***
bOb_messages_error_handling_2209@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-01-25 16:34:20.131 ***
bOb_messages_error_handling_2209@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-01-25 16:34:20.131 ***
bOb_messages_error_handling_2209@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='8604d53fe1e540ab' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-01-25 16:34:20.131 ***
bOb_messages_error_handling_2209@localhost/res1 in
<stream:features>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-01-25 16:34:20.131 ***
bOb_messages_error_handling_2209@localhost/res1 out
<iq type='set' id='9da15d4eedac1d5d8effb6f091f91ff5'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.131 ***
bOb_messages_error_handling_2209@localhost/res1 in
<iq id='9da15d4eedac1d5d8effb6f091f91ff5' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb_messages_error_handling_2209@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-01-25 16:34:20.132 ***
bOb_messages_error_handling_2209@localhost/res1 out
<iq type='set' id='706bed04532c308ff1071812fa4d0189'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.132 ***
bOb_messages_error_handling_2209@localhost/res1 in
<iq type='result' id='706bed04532c308ff1071812fa4d0189'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-01-25 16:34:20.132 ***
bOb_messages_error_handling_2209@localhost/res1 out
<presence/>



*** User 2022-01-25 16:34:20.134 ***
bOb_messages_error_handling_2209@localhost/res1 in
<presence from='bOb_messages_error_handling_2209@localhost/res1' to='bob_messages_error_handling_2209@localhost/res1' xml:lang='en'/>



*** User 2022-01-25 16:34:20.137 ***
REST request fails:
Code: 400
Req: {<0.7939.2>,<<"/api/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"22270a823ca6811c">>}],
      <<"{\"to\":\"@noway\",\"caller\":\"alice_messages_error_handling_2209@localhost\",\"body\":\"whatever\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"25">>}],
         <<"Invalid jid: <<\"@noway\">>">>,158,1454}
Params: #{body =>
              <<"{\"to\":\"@noway\",\"caller\":\"alice_messages_error_handling_2209@localhost\",\"body\":\"whatever\"}">>,
          method => <<"POST">>,path => <<"/api/messages">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.138 ***
REST request fails:
Code: 400
Req: {<0.7947.2>,<<"/api/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"9aa676fa48140c5a">>}],
      <<"{\"to\":\"bob_messages_error_handling_2209@localhost\",\"caller\":\"@noway\",\"body\":\"whatever\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"25">>}],
         <<"Invalid jid: <<\"@noway\">>">>,158,729}
Params: #{body =>
              <<"{\"to\":\"bob_messages_error_handling_2209@localhost\",\"caller\":\"@noway\",\"body\":\"whatever\"}">>,
          method => <<"POST">>,path => <<"/api/messages">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.139 ***
bOb_messages_error_handling_2209@localhost/res1 out
</stream:stream>

*** User 2022-01-25 16:34:20.139 ***
bOb_messages_error_handling_2209@localhost/res1 in
</stream:stream>

*** User 2022-01-25 16:34:20.140 ***
alicE_messages_error_handling_2209@localhost/res1 out
</stream:stream>

*** User 2022-01-25 16:34:20.140 ***
alicE_messages_error_handling_2209@localhost/res1 in
</stream:stream>
*** CT 2022-01-25 16:34:20.143 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_2377.html
*** CT 2022-01-25 16:34:20.144 *** View log from node mongooseim@localhost when finished mongooseim@localhost_5708.html



=== Ended at 2022-01-25 16:34:20
=== successfully completed test case
=== === Returned value: ok