Class AbstractNonParameterizedJerseyStreamingHttpServiceTest

    • Method Detail

      • data

        public static java.util.Collection<java.lang.Object[]> data()
      • initServerAndClient

        public final void initServerAndClient()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • closeClient

        public final void closeClient()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • closeServer

        public final void closeServer()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • application

        protected abstract javax.ws.rs.core.Application application()
      • host

        protected java.lang.String host()
      • isStreamingJsonEnabled

        protected boolean isStreamingJsonEnabled()
      • testUri

        protected java.lang.String testUri​(java.lang.String path)
      • post

        protected StreamingHttpRequest post​(java.lang.String path,
                                            java.lang.CharSequence payload,
                                            java.lang.CharSequence contentType)
      • put

        protected StreamingHttpRequest put​(java.lang.String path,
                                           java.lang.CharSequence payload,
                                           java.lang.CharSequence contentType)
      • payloadRequest

        protected StreamingHttpRequest payloadRequest​(HttpRequestMethod method,
                                                      java.lang.String path,
                                                      java.lang.CharSequence payload,
                                                      java.lang.CharSequence contentType)
      • getJsonResponseContentLengthExtractor

        protected java.util.function.Function<java.lang.String,​java.lang.Integer> getJsonResponseContentLengthExtractor()
      • sendAndAssertResponse

        protected StreamingHttpResponse sendAndAssertResponse​(StreamingHttpRequest req,
                                                              HttpResponseStatus expectedStatus,
                                                              @Nullable
                                                              java.lang.CharSequence expectedContentType,
                                                              org.hamcrest.Matcher<java.lang.String> contentMatcher,
                                                              java.util.function.Function<java.lang.String,​java.lang.Integer> expectedContentLengthExtractor)
      • sendAndAssertResponse

        protected StreamingHttpResponse sendAndAssertResponse​(StreamingHttpRequest req,
                                                              HttpProtocolVersion expectedHttpVersion,
                                                              HttpResponseStatus expectedStatus,
                                                              @Nullable
                                                              java.lang.CharSequence expectedContentType,
                                                              org.hamcrest.Matcher<java.lang.String> contentMatcher,
                                                              java.util.function.Function<java.lang.String,​java.lang.Integer> expectedContentLengthExtractor)
      • runTwiceToEnsureEndpointCache

        protected static void runTwiceToEnsureEndpointCache​(java.lang.Runnable test)
        Runs the provided test lambda multiple times.

        some tests depend on Endpoint enhancement which is now backed by a cache, so we test the test code multiple times to ensure that the caching of endpoints doesn't cause any weird side-effects.

        Parameters:
        test - Runnable test callback will be executed multiple times, typically this is run from a @Test within a single setup/teardown cycle