use of org.graylog.shaded.elasticsearch7.org.apache.http.ProtocolVersion in project moco by dreamhead.
the class MocoTest method should_return_same_http_version_without_specified_version_for_error_response.
@Test
public void should_return_same_http_version_without_specified_version_for_error_response() throws Exception {
running(server, () -> {
ProtocolVersion version10 = helper.execute(Request.Get(root()).version(HttpVersion.HTTP_1_0)).getProtocolVersion();
assertThat(version10.getMajor(), is(1));
assertThat(version10.getMinor(), is(0));
ProtocolVersion version11 = helper.execute(Request.Get(root()).version(HttpVersion.HTTP_1_1)).getProtocolVersion();
assertThat(version11.getMajor(), is(1));
assertThat(version11.getMinor(), is(1));
});
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.ProtocolVersion in project moco by dreamhead.
the class MocoTest method should_return_expected_version.
@Test
public void should_return_expected_version() throws Exception {
server.response(version(VERSION_1_0));
running(server, () -> {
ProtocolVersion version = helper.getResponse(root()).getProtocolVersion();
assertThat(version.getMajor(), is(1));
assertThat(version.getMinor(), is(0));
});
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.ProtocolVersion in project moco by dreamhead.
the class MocoTest method should_return_excepted_version_with_version_api.
@Test
public void should_return_excepted_version_with_version_api() throws Exception {
server.response(version(VERSION_1_0));
running(server, () -> {
ProtocolVersion version = helper.getResponse(root()).getProtocolVersion();
assertThat(version.getMajor(), is(1));
assertThat(version.getMinor(), is(0));
});
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.ProtocolVersion in project moco by dreamhead.
the class MocoTemplateStandaloneTest method should_return_version_from_template.
@Test
public void should_return_version_from_template() throws IOException {
runWithConfiguration("template.json");
ProtocolVersion version = helper.execute(Request.Get(remoteUrl("/version_template")).version(HttpVersion.HTTP_1_0)).getProtocolVersion();
assertThat(version.toString(), is("HTTP/1.0"));
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.ProtocolVersion in project moco by dreamhead.
the class MocoStandaloneTest method should_return_specified_version_for_request.
@Test
public void should_return_specified_version_for_request() throws IOException {
runWithConfiguration("foo.json");
ProtocolVersion version = helper.execute(Request.Get(remoteUrl("/version10"))).getProtocolVersion();
assertThat(version.getProtocol(), is("HTTP"));
assertThat(version.getMajor(), is(1));
assertThat(version.getMinor(), is(0));
}
Aggregations