Search in sources :

Example 1 with StreamingHttpClient

use of io.servicetalk.http.api.StreamingHttpClient in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method clientAllowDropTrailers.

private void clientAllowDropTrailers(boolean allowDrop, boolean serverAddTrailerHeader) throws Exception {
    String trailerName = "t1";
    String trailerValue = "v1";
    InetSocketAddress serverAddress = serverAddTrailerHeader ? bindHttpEchoServerWithTrailer(trailerName) : bindHttpEchoServer();
    try (StreamingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).allowDropResponseTrailers(allowDrop).executionStrategy(clientExecutionStrategy).buildStreaming()) {
        StreamingHttpResponse response = client.request(client.get("/").transform(new StatelessTrailersTransformer<Buffer>() {

            @Override
            protected HttpHeaders payloadComplete(final HttpHeaders trailers) {
                trailers.add(trailerName, trailerValue);
                return trailers;
            }
        })).toFuture().get();
        SingleSource.Processor<HttpHeaders, HttpHeaders> trailersProcessor = Processors.newSingleProcessor();
        // intermediate Buffer transform may drop trailers
        response.transformPayloadBody(buf -> buf).transform(new StatelessTrailersTransformer<Buffer>() {

            @Override
            protected HttpHeaders payloadComplete(final HttpHeaders trailers) {
                trailersProcessor.onSuccess(trailers);
                return trailers;
            }
        }).messageBody().ignoreElements().toFuture().get();
        HttpHeaders responseTrailers = fromSource(trailersProcessor).toFuture().get();
        if (allowDrop && !serverAddTrailerHeader) {
            assertFalse(responseTrailers.contains(trailerName));
        } else {
            assertHeaderValue(responseTrailers, trailerName, trailerValue);
        }
    }
}
Also used : TestUtils.assertNoAsyncErrors(io.servicetalk.test.resources.TestUtils.assertNoAsyncErrors) UnaryOperator.identity(java.util.function.UnaryOperator.identity) ChannelInboundHandlerAdapter(io.netty.channel.ChannelInboundHandlerAdapter) SingleSource(io.servicetalk.concurrent.SingleSource) StreamingHttpServiceFilterFactory(io.servicetalk.http.api.StreamingHttpServiceFilterFactory) UnaryOperator(java.util.function.UnaryOperator) DefaultHttp2DataFrame(io.netty.handler.codec.http2.DefaultHttp2DataFrame) Disabled(org.junit.jupiter.api.Disabled) Matchers.hasItems(org.hamcrest.Matchers.hasItems) SourceAdapters.fromSource(io.servicetalk.concurrent.api.SourceAdapters.fromSource) H2StreamResetException(io.servicetalk.http.netty.NettyHttp2ExceptionUtils.H2StreamResetException) AsyncContext(io.servicetalk.concurrent.api.AsyncContext) HttpRequest(io.servicetalk.http.api.HttpRequest) Assumptions.assumeFalse(org.junit.jupiter.api.Assumptions.assumeFalse) Matchers.nullValue(org.hamcrest.Matchers.nullValue) HttpCookiePair(io.servicetalk.http.api.HttpCookiePair) EXPECT(io.servicetalk.http.api.HttpHeaderNames.EXPECT) BlockingHttpClient(io.servicetalk.http.api.BlockingHttpClient) PrintWriter(java.io.PrintWriter) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) DefaultHttp2SettingsFrame(io.netty.handler.codec.http2.DefaultHttp2SettingsFrame) HttpClients.forSingleAddress(io.servicetalk.http.netty.HttpClients.forSingleAddress) HttpResponse(io.servicetalk.http.api.HttpResponse) Http2SettingsAckFrame(io.netty.handler.codec.http2.Http2SettingsAckFrame) TRANSFER_ENCODING(io.servicetalk.http.api.HttpHeaderNames.TRANSFER_ENCODING) POST(io.servicetalk.http.api.HttpRequestMethod.POST) BlockingQueue(java.util.concurrent.BlockingQueue) ChannelPipeline(io.netty.channel.ChannelPipeline) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) StatelessTrailersTransformer(io.servicetalk.http.api.StatelessTrailersTransformer) StreamingHttpClientFilter(io.servicetalk.http.api.StreamingHttpClientFilter) StreamingHttpConnectionFilter(io.servicetalk.http.api.StreamingHttpConnectionFilter) Arguments(org.junit.jupiter.params.provider.Arguments) Assertions.assertNotSame(org.junit.jupiter.api.Assertions.assertNotSame) Http2HeadersFrame(io.netty.handler.codec.http2.Http2HeadersFrame) CountDownLatch(java.util.concurrent.CountDownLatch) HttpSetCookie(io.servicetalk.http.api.HttpSetCookie) Buffer(io.servicetalk.buffer.api.Buffer) Stream(java.util.stream.Stream) Http2Headers(io.netty.handler.codec.http2.Http2Headers) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) COOKIE(io.servicetalk.http.api.HttpHeaderNames.COOKIE) Matchers.is(org.hamcrest.Matchers.is) CONTENT_TYPE(io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Processor(io.servicetalk.concurrent.PublisherSource.Processor) BuilderUtils.serverChannel(io.servicetalk.transport.netty.internal.BuilderUtils.serverChannel) TRAILER(io.netty.handler.codec.http.HttpHeaderNames.TRAILER) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) HttpHeaders(io.servicetalk.http.api.HttpHeaders) ConsumableEvent(io.servicetalk.client.api.ConsumableEvent) StreamingHttpRequester(io.servicetalk.http.api.StreamingHttpRequester) FilterableStreamingHttpConnection(io.servicetalk.http.api.FilterableStreamingHttpConnection) ArrayList(java.util.ArrayList) EMPTY_BUFFER(io.servicetalk.buffer.api.EmptyBuffer.EMPTY_BUFFER) MAX_CONCURRENCY(io.servicetalk.http.api.HttpEventKey.MAX_CONCURRENCY) HeaderUtils.isTransferEncodingChunked(io.servicetalk.http.api.HeaderUtils.isTransferEncodingChunked) HttpServiceContext(io.servicetalk.http.api.HttpServiceContext) Single.succeeded(io.servicetalk.concurrent.api.Single.succeeded) Processors(io.servicetalk.concurrent.api.Processors) BiConsumer(java.util.function.BiConsumer) Assumptions.assumeTrue(org.junit.jupiter.api.Assumptions.assumeTrue) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) Matchers.contentEqualTo(io.servicetalk.buffer.api.Matchers.contentEqualTo) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Nullable(javax.annotation.Nullable) SMALLEST_MAX_CONCURRENT_STREAMS(io.netty.handler.codec.http2.Http2CodecUtil.SMALLEST_MAX_CONCURRENT_STREAMS) DEFAULT(io.servicetalk.http.netty.HttpTestExecutionStrategy.DEFAULT) Single(io.servicetalk.concurrent.api.Single) StringWriter(java.io.StringWriter) Completable(io.servicetalk.concurrent.api.Completable) DefaultHttp2HeadersFrame(io.netty.handler.codec.http2.DefaultHttp2HeadersFrame) IOException(java.io.IOException) ReservedBlockingHttpConnection(io.servicetalk.http.api.ReservedBlockingHttpConnection) OK(io.servicetalk.http.api.HttpResponseStatus.OK) GET(io.servicetalk.http.api.HttpRequestMethod.GET) Channel(io.netty.channel.Channel) Http2Settings(io.netty.handler.codec.http2.Http2Settings) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) String.valueOf(java.lang.String.valueOf) Completable.completed(io.servicetalk.concurrent.api.Completable.completed) Http2MultiplexHandler(io.netty.handler.codec.http2.Http2MultiplexHandler) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) HttpResponseStatus(io.servicetalk.http.api.HttpResponseStatus) HostAndPort(io.servicetalk.transport.api.HostAndPort) HttpRequestMethod(io.servicetalk.http.api.HttpRequestMethod) Matchers.emptyString(org.hamcrest.Matchers.emptyString) Http2FrameCodecBuilder(io.netty.handler.codec.http2.Http2FrameCodecBuilder) Key.newKey(io.servicetalk.context.api.ContextMap.Key.newKey) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Http2DataFrame(io.netty.handler.codec.http2.Http2DataFrame) MethodSource(org.junit.jupiter.params.provider.MethodSource) ChannelDuplexHandler(io.netty.channel.ChannelDuplexHandler) ChannelInitializer(io.netty.channel.ChannelInitializer) PublisherSource(io.servicetalk.concurrent.PublisherSource) CONTENT_LENGTH(io.servicetalk.http.api.HttpHeaderNames.CONTENT_LENGTH) InetSocketAddress(java.net.InetSocketAddress) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) HttpEventKey(io.servicetalk.http.api.HttpEventKey) List(java.util.List) ContextMap(io.servicetalk.context.api.ContextMap) DelegatingConnectionAcceptor(io.servicetalk.transport.api.DelegatingConnectionAcceptor) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Writer(java.io.Writer) Queue(java.util.Queue) CONTINUE(io.servicetalk.http.api.HttpHeaderValues.CONTINUE) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) Publisher(io.servicetalk.concurrent.api.Publisher) Http2Exception(io.servicetalk.http.api.Http2Exception) AtomicReference(java.util.concurrent.atomic.AtomicReference) StreamingHttpServiceFilter(io.servicetalk.http.api.StreamingHttpServiceFilter) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) HttpProtocolConfigs.h1Default(io.servicetalk.http.netty.HttpProtocolConfigs.h1Default) HttpProtocolConfigs.h2Default(io.servicetalk.http.netty.HttpProtocolConfigs.h2Default) HttpSerializers.textSerializerUtf8(io.servicetalk.http.api.HttpSerializers.textSerializerUtf8) HttpExecutionStrategy(io.servicetalk.http.api.HttpExecutionStrategy) NettyConnectionContext(io.servicetalk.transport.netty.internal.NettyConnectionContext) DELIBERATE_EXCEPTION(io.servicetalk.concurrent.internal.DeliberateException.DELIBERATE_EXCEPTION) HttpServerBuilder(io.servicetalk.http.api.HttpServerBuilder) ConnectionContext(io.servicetalk.transport.api.ConnectionContext) INTERNAL_SERVER_ERROR(io.servicetalk.http.api.HttpResponseStatus.INTERNAL_SERVER_ERROR) AddressUtils.localAddress(io.servicetalk.transport.netty.internal.AddressUtils.localAddress) EventLoopGroup(io.netty.channel.EventLoopGroup) ServerContext(io.servicetalk.transport.api.ServerContext) Iterator(java.util.Iterator) EXPECTATION_FAILED(io.servicetalk.http.api.HttpResponseStatus.EXPECTATION_FAILED) NettyIoExecutors.createIoExecutor(io.servicetalk.transport.netty.internal.NettyIoExecutors.createIoExecutor) UTF_8(java.nio.charset.StandardCharsets.UTF_8) Processors.newPublisherProcessor(io.servicetalk.concurrent.api.Processors.newPublisherProcessor) Consumer(java.util.function.Consumer) Matchers.emptyIterable(org.hamcrest.Matchers.emptyIterable) StreamingHttpResponseFactory(io.servicetalk.http.api.StreamingHttpResponseFactory) NO_OFFLOAD(io.servicetalk.http.netty.HttpTestExecutionStrategy.NO_OFFLOAD) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) ChannelHandler(io.netty.channel.ChannelHandler) SET_COOKIE(io.servicetalk.http.api.HttpHeaderNames.SET_COOKIE) DefaultHttpCookiePair(io.servicetalk.http.api.DefaultHttpCookiePair) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) Buffer(io.servicetalk.buffer.api.Buffer) HttpHeaders(io.servicetalk.http.api.HttpHeaders) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) SingleSource(io.servicetalk.concurrent.SingleSource) InetSocketAddress(java.net.InetSocketAddress) StatelessTrailersTransformer(io.servicetalk.http.api.StatelessTrailersTransformer) Matchers.emptyString(org.hamcrest.Matchers.emptyString) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse)

Example 2 with StreamingHttpClient

use of io.servicetalk.http.api.StreamingHttpClient in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method clientGracefulClose.

@ParameterizedTest(name = "{displayName} [{index}] client={0}, h2PriorKnowledge={1}")
@MethodSource("clientExecutors")
void clientGracefulClose(HttpTestExecutionStrategy strategy, boolean h2PriorKnowledge) throws Exception {
    setUp(strategy, h2PriorKnowledge);
    InetSocketAddress serverAddress = bindHttpEchoServer();
    StreamingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).buildStreaming();
    CountDownLatch onCloseLatch = new CountDownLatch(1);
    Processor<Buffer, Buffer> requestBody = newProcessor();
    client.onClose().subscribe(onCloseLatch::countDown);
    // We want to make a request, and intentionally not complete it. While the request is in process we invoke
    // closeAsyncGracefully and verify that we wait until the request has completed before the underlying
    // transport is closed.
    StreamingHttpRequest request = client.post("/").payloadBody(fromSource(requestBody));
    StreamingHttpResponse response = client.request(request).toFuture().get();
    client.closeAsyncGracefully().subscribe();
    // We expect this to timeout, because we have not completed the outstanding request.
    assertFalse(onCloseLatch.await(300, MILLISECONDS));
    requestBody.onComplete();
    response.payloadBody().ignoreElements().toFuture();
    onCloseLatch.await();
}
Also used : Buffer(io.servicetalk.buffer.api.Buffer) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) InetSocketAddress(java.net.InetSocketAddress) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) CountDownLatch(java.util.concurrent.CountDownLatch) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 3 with StreamingHttpClient

use of io.servicetalk.http.api.StreamingHttpClient in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method continue100.

private void continue100(boolean failExpectation) throws Exception {
    InetSocketAddress serverAddress = bindHttpEchoServer();
    try (StreamingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).buildStreaming()) {
        Processor<Buffer, Buffer> requestBody1 = newProcessor();
        StreamingHttpRequest request = client.post("/").payloadBody(fromSource(requestBody1));
        request.addHeader(EXPECT, CONTINUE);
        if (failExpectation) {
            request.addHeader(EXPECT_FAIL_HEADER, "notused");
        }
        StreamingHttpResponse response = client.request(request).toFuture().get();
        if (failExpectation) {
            assertEquals(EXPECTATION_FAILED, response.status());
            assertFalse(response.payloadBody().toIterable().iterator().hasNext());
        } else {
            assertEquals(HttpResponseStatus.CONTINUE, response.status());
            String payloadBody = "foo";
            requestBody1.onNext(client.executionContext().bufferAllocator().fromAscii(payloadBody));
            requestBody1.onComplete();
            Iterator<Buffer> responseBody = response.payloadBody().toIterable().iterator();
            assertTrue(responseBody.hasNext());
            Buffer next = responseBody.next();
            assertNotNull(next);
            assertEquals(payloadBody, next.toString(UTF_8));
            assertFalse(responseBody.hasNext());
        }
    }
}
Also used : Buffer(io.servicetalk.buffer.api.Buffer) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) InetSocketAddress(java.net.InetSocketAddress) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) Matchers.emptyString(org.hamcrest.Matchers.emptyString) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse)

Example 4 with StreamingHttpClient

use of io.servicetalk.http.api.StreamingHttpClient in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method fullDuplexMode.

@ParameterizedTest(name = "{displayName} [{index}] client={0}, h2PriorKnowledge={1}")
@MethodSource("clientExecutors")
void fullDuplexMode(HttpTestExecutionStrategy strategy, boolean h2PriorKnowledge) throws Exception {
    setUp(strategy, h2PriorKnowledge);
    InetSocketAddress serverAddress = bindHttpEchoServer();
    try (StreamingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).buildStreaming()) {
        Processor<Buffer, Buffer> requestBody1 = newProcessor();
        StreamingHttpResponse response1 = client.request(client.post("/0").payloadBody(fromSource(requestBody1))).toFuture().get();
        Processor<Buffer, Buffer> requestBody2 = newProcessor();
        StreamingHttpResponse response2 = client.request(client.post("/1").payloadBody(fromSource(requestBody2))).toFuture().get();
        Iterator<Buffer> response1Payload = response1.payloadBody().toIterable().iterator();
        Iterator<Buffer> response2Payload = response2.payloadBody().toIterable().iterator();
        fullDuplexModeWrite(client, requestBody1, "foo1", requestBody2, "bar1", response1Payload, response2Payload);
        fullDuplexModeWrite(client, requestBody1, "foo2", requestBody2, "bar2", response1Payload, response2Payload);
        requestBody1.onComplete();
        requestBody2.onComplete();
        assertFalse(response1Payload.hasNext());
        assertFalse(response2Payload.hasNext());
    }
}
Also used : Buffer(io.servicetalk.buffer.api.Buffer) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) InetSocketAddress(java.net.InetSocketAddress) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 5 with StreamingHttpClient

use of io.servicetalk.http.api.StreamingHttpClient in project servicetalk by apple.

the class HttpClientAsyncContextTest method makeClientRequestWithId.

private static void makeClientRequestWithId(StreamingHttpClient client, String requestId) throws ExecutionException, InterruptedException {
    StreamingHttpRequest request = client.get("/");
    request.headers().set(REQUEST_ID_HEADER, requestId);
    client.request(request).whenOnSuccess(response -> assertEquals(OK, response.status())).flatMapCompletable(response -> response.messageBody().ignoreElements()).toFuture().get();
}
Also used : FilterableStreamingHttpClient(io.servicetalk.http.api.FilterableStreamingHttpClient) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) StreamingHttpRequester(io.servicetalk.http.api.StreamingHttpRequester) CharSequences.newAsciiString(io.servicetalk.buffer.api.CharSequences.newAsciiString) Key.newKey(io.servicetalk.context.api.ContextMap.Key.newKey) Subscriber(io.servicetalk.concurrent.PublisherSource.Subscriber) AsyncContext(io.servicetalk.concurrent.api.AsyncContext) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) Single.succeeded(io.servicetalk.concurrent.api.Single.succeeded) HttpExecutionStrategies(io.servicetalk.http.api.HttpExecutionStrategies) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) AddressUtils.serverHostAndPort(io.servicetalk.transport.netty.internal.AddressUtils.serverHostAndPort) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) ValueSource(org.junit.jupiter.params.provider.ValueSource) AddressUtils.localAddress(io.servicetalk.transport.netty.internal.AddressUtils.localAddress) Matchers.empty(org.hamcrest.Matchers.empty) ServerContext(io.servicetalk.transport.api.ServerContext) Single(io.servicetalk.concurrent.api.Single) Subscription(io.servicetalk.concurrent.PublisherSource.Subscription) StreamingHttpClientFilter(io.servicetalk.http.api.StreamingHttpClientFilter) OK(io.servicetalk.http.api.HttpResponseStatus.OK) InetSocketAddress(java.net.InetSocketAddress) SingleAddressHttpClientBuilder(io.servicetalk.http.api.SingleAddressHttpClientBuilder) ExecutionException(java.util.concurrent.ExecutionException) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ContextMap(io.servicetalk.context.api.ContextMap) Queue(java.util.Queue) HostAndPort(io.servicetalk.transport.api.HostAndPort) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest)

Aggregations

StreamingHttpClient (io.servicetalk.http.api.StreamingHttpClient)77 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)48 RedirectConfigBuilder (io.servicetalk.http.api.RedirectConfigBuilder)33 StreamingHttpRequest (io.servicetalk.http.api.StreamingHttpRequest)30 Test (org.junit.jupiter.api.Test)30 StreamingHttpResponse (io.servicetalk.http.api.StreamingHttpResponse)26 Buffer (io.servicetalk.buffer.api.Buffer)24 MethodSource (org.junit.jupiter.params.provider.MethodSource)22 StreamingHttpConnection (io.servicetalk.http.api.StreamingHttpConnection)19 InetSocketAddress (java.net.InetSocketAddress)16 HttpServerContext (io.servicetalk.http.api.HttpServerContext)15 SingleAddressHttpClientBuilder (io.servicetalk.http.api.SingleAddressHttpClientBuilder)15 ServerContext (io.servicetalk.transport.api.ServerContext)14 Single (io.servicetalk.concurrent.api.Single)12 BufferAllocator (io.servicetalk.buffer.api.BufferAllocator)11 HostAndPort (io.servicetalk.transport.api.HostAndPort)11 CountDownLatch (java.util.concurrent.CountDownLatch)11 ExecutionException (java.util.concurrent.ExecutionException)11 Single.succeeded (io.servicetalk.concurrent.api.Single.succeeded)10 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)10