Skip to content

Fixed Async and NetCurl tests #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions t/30_Logger_Async/40_trace_request.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ok $l->trace_request(

is $format, <<'REQUEST', 'No body - format';
# Request to: https://foo.bar:444/some/path
curl -XPOST 'http://localhost:9200/xyz?foo=bar&pretty=1'
curl -XPOST 'http://localhost:9200/xyz?foo=bar&pretty=true'
REQUEST

# Std body
Expand All @@ -47,7 +47,7 @@ ok $l->trace_request(

is $format, <<'REQUEST', 'Body - format';
# Request to: https://foo.bar:444/some/path
curl -H "Content-type: application/json" -XPOST 'http://localhost:9200/xyz?foo=bar&pretty=1' -d '
curl -H "Content-type: application/json" -XPOST 'http://localhost:9200/xyz?foo=bar&pretty=true' -d '
{
"foo" : "bar\n\u0027baz"
}
Expand All @@ -71,7 +71,7 @@ ok $l->trace_request(

is $format, <<'REQUEST', 'Bulk - format';
# Request to: https://foo.bar:444/some/path
curl -H "Content-type: application/json" -XPOST 'http://localhost:9200/xyz?foo=bar&pretty=1' -d '
curl -H "Content-type: application/json" -XPOST 'http://localhost:9200/xyz?foo=bar&pretty=true' -d '
{"foo":"bar\n\u0027baz"}
{"foo":"bar\n\u0027baz"}
'
Expand All @@ -93,7 +93,7 @@ ok $l->trace_request(

is $format, <<'REQUEST', 'Body string - format';
# Request to: https://foo.bar:444/some/path
curl -H "Content-type: application/json" -XPOST 'http://localhost:9200/xyz?foo=bar&pretty=1' -d '
curl -H "Content-type: application/json" -XPOST 'http://localhost:9200/xyz?foo=bar&pretty=true' -d '
The quick brown fox
jumped over the lazy dog\u0027s basket'
REQUEST
Expand Down
6 changes: 4 additions & 2 deletions t/60_Cxn_Async/30_http.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ use Test::More;
use Test::Exception;
use Test::Deep;
use Search::Elasticsearch::Async;
use Search::Elasticsearch::Role::Cxn;

sub is_cxn(@);

my $username = 'ThisIsAVeryLongUsernameAndThatIsOKYouSee';
my $password = 'CorrectHorseBatteryStapleCorrectHorseBatteryStaple';
my $useragent = Search::Elasticsearch::Role::Cxn::get_user_agent();

### Scalar nodes ###

Expand Down Expand Up @@ -88,7 +90,7 @@ is_cxn "Path option with settings",

is_cxn "Deflate option",
new_cxn( deflate => 1 ),
{ default_headers => { 'Accept-Encoding' => 'deflate' } };
{ default_headers => { 'Accept-Encoding' => 'deflate', 'User-Agent' => $useragent } };

is_cxn "IPv4 with Port",
new_cxn( nodes => '127.0.0.1', port => 456 ),
Expand Down Expand Up @@ -148,7 +150,7 @@ sub is_cxn (@) {
port => '9200',
scheme => 'http',
uri => 'http://localhost:9200',
default_headers => {},
default_headers => { 'User-Agent' => $useragent },
userinfo => '',
%$params
);
Expand Down