You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2026/06/09 01:10:21 UTC
(juneau) branch master updated: TODO-160: migrate juneau-utest into co-located module tests
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new b578ccffc8 TODO-160: migrate juneau-utest into co-located module tests
b578ccffc8 is described below
commit b578ccffc8054c69b0108cd2c13878f54b20a66b
Author: James Bognar <ja...@apache.org>
AuthorDate: Mon Jun 8 21:10:14 2026 -0400
TODO-160: migrate juneau-utest into co-located module tests
- Wire juneau-test-utils into the juneau-core reactor (fixes build break) and
remove 55 duplicated shared test-helper files across 17 modules.
- Rework test.py to emit per-module performance statistics with a per-module
perf-baseline.txt relocated to the project root; make check-container-tags.py
scan all src/test/java roots.
- Delete-phase: remove ~1,000 duplicated unit tests from juneau-utest after
parity verification (html5 pilot + clean modules), relocate transport tests,
and strip the juneau-rest-mock catch-all (446 -> 13 test files).
- MockRestClient integration tests remain in juneau-utest (the integration
residual) since co-locating them creates reactor cycles.
---
juneau-bean/juneau-bean-atom/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-common/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-hal/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-html5/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-jsonapi/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-jsonpatch/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-jsonschema/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-mcp/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-openapi-v3/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-rfc7807/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-bean/juneau-bean-swagger-v2/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-core/juneau-assertions/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
.../pojos/PrimitiveAtomicObjectsBean.java | 82 -
.../testutils/pojos/PrimitiveObjectsBean.java | 186 --
.../apache/juneau/testutils/pojos/TestEnum.java | 21 -
.../juneau/testutils/pojos/TestEnumToString.java | 42 -
.../juneau/utest/utils/CapturingPrintStream.java | 34 -
.../org/apache/juneau/utest/utils/Constants.java | 24 -
.../juneau/utest/utils/FakeTimeProvider.java | 46 -
.../apache/juneau/utest/utils/MutableSupplier.java | 40 -
juneau-core/juneau-bct/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-core/juneau-config/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
.../pojos/PrimitiveAtomicObjectsBean.java | 82 -
.../testutils/pojos/PrimitiveObjectsBean.java | 186 --
.../apache/juneau/testutils/pojos/TestEnum.java | 21 -
.../juneau/testutils/pojos/TestEnumToString.java | 42 -
.../juneau/utest/utils/CapturingPrintStream.java | 34 -
.../org/apache/juneau/utest/utils/Constants.java | 24 -
.../juneau/utest/utils/FakeTimeProvider.java | 46 -
.../apache/juneau/utest/utils/MutableSupplier.java | 40 -
juneau-core/juneau-junit5/pom.xml | 6 +
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
juneau-core/juneau-marshall/pom.xml | 6 +
.../juneau/CloseableByteArrayInputStream.java | 42 -
.../org/apache/juneau/CloseableStringReader.java | 52 -
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
.../src/test/java/org/apache/juneau/XVar.java | 44 -
.../pojos/PrimitiveAtomicObjectsBean.java | 82 -
.../testutils/pojos/PrimitiveObjectsBean.java | 186 --
.../apache/juneau/testutils/pojos/TestEnum.java | 21 -
.../juneau/testutils/pojos/TestEnumToString.java | 42 -
.../juneau/utest/utils/CapturingPrintStream.java | 34 -
.../org/apache/juneau/utest/utils/Constants.java | 24 -
.../juneau/utest/utils/FakeTimeProvider.java | 46 -
.../apache/juneau/utest/utils/MutableSupplier.java | 40 -
juneau-core/pom.xml | 1 +
.../logs/jetty-requests.log.010714689 | 0
.../pom.xml | 6 +
.../rest/client/ApacheHc45Transport_Test.java | 0
.../pom.xml | 6 +
.../rest/client/ApacheHc5Transport_Test.java | 0
juneau-rest/juneau-rest-client-classic/pom.xml | 6 +
.../classic/remote/RemoteOperationArg_Test.java | 0
juneau-rest/juneau-rest-client-jetty/pom.xml | 6 +
.../rest/client/JettyHttpTransport_Test.java | 0
juneau-rest/juneau-rest-client-okhttp/pom.xml | 6 +
.../juneau/rest/client/OkHttpTransport_Test.java | 0
juneau-rest/juneau-rest-client/pom.xml | 6 +
.../juneau/rest/client/JavaHttpTransport_Test.java | 0
.../src/test/java/jakarta/inject/Inject.java | 36 -
.../test/java/org/apache/juneau/BeanTester.java | 299 --
.../src/test/java/org/apache/juneau/TestUtils.java | 540 ----
.../http/classic/SerializedHttpEntity_Test.java | 118 -
.../http/classic/header/AcceptCharset_Test.java | 84 -
.../http/classic/header/AcceptEncoding_Test.java | 84 -
.../http/classic/header/AcceptLanguage_Test.java | 84 -
.../http/classic/header/AcceptRanges_Test.java | 76 -
.../juneau/http/classic/header/Accept_Test.java | 93 -
.../juneau/http/classic/header/Age_Test.java | 83 -
.../juneau/http/classic/header/Allow_Test.java | 83 -
.../http/classic/header/Authorization_Test.java | 76 -
.../classic/header/BasicBooleanHeader_Test.java | 108 -
.../http/classic/header/BasicCsvHeader_Test.java | 137 -
.../http/classic/header/BasicDateHeader_Test.java | 113 -
.../classic/header/BasicEntityTagHeader_Test.java | 110 -
.../classic/header/BasicEntityTagsHeader_Test.java | 101 -
.../classic/header/BasicIntegerHeader_Test.java | 110 -
.../http/classic/header/BasicLongHeader_Test.java | 104 -
.../header/BasicMediaRangesHeader_Test.java | 115 -
.../classic/header/BasicMediaTypeHeader_Test.java | 131 -
.../classic/header/BasicStringHeader_Test.java | 84 -
.../header/BasicStringRangesHeader_Test.java | 93 -
.../http/classic/header/BasicUriHeader_Test.java | 90 -
.../http/classic/header/CacheControl_Test.java | 78 -
.../http/classic/header/ClientVersion_Test.java | 79 -
.../http/classic/header/Connection_Test.java | 91 -
.../classic/header/ContentDisposition_Test.java | 104 -
.../http/classic/header/ContentEncoding_Test.java | 78 -
.../http/classic/header/ContentLanguage_Test.java | 83 -
.../http/classic/header/ContentLength_Test.java | 83 -
.../http/classic/header/ContentLocation_Test.java | 84 -
.../http/classic/header/ContentRange_Test.java | 78 -
.../http/classic/header/ContentType_Test.java | 85 -
.../juneau/http/classic/header/Date_Test.java | 86 -
.../juneau/http/classic/header/Debug_Test.java | 79 -
.../juneau/http/classic/header/ETag_Test.java | 93 -
.../juneau/http/classic/header/Expect_Test.java | 78 -
.../juneau/http/classic/header/Expires_Test.java | 86 -
.../juneau/http/classic/header/Forwarded_Test.java | 78 -
.../juneau/http/classic/header/From_Test.java | 78 -
.../juneau/http/classic/header/Host_Test.java | 78 -
.../juneau/http/classic/header/IfMatch_Test.java | 84 -
.../http/classic/header/IfModifiedSince_Test.java | 86 -
.../http/classic/header/IfNoneMatch_Test.java | 84 -
.../juneau/http/classic/header/IfRange_Test.java | 104 -
.../classic/header/IfUnmodifiedSince_Test.java | 86 -
.../http/classic/header/LastModified_Test.java | 86 -
.../juneau/http/classic/header/Location_Test.java | 84 -
.../http/classic/header/MaxForwards_Test.java | 83 -
.../juneau/http/classic/header/NoTrace_Test.java | 83 -
.../juneau/http/classic/header/Origin_Test.java | 78 -
.../juneau/http/classic/header/Pragma_Test.java | 78 -
.../classic/header/ProxyAuthenticate_Test.java | 78 -
.../classic/header/ProxyAuthorization_Test.java | 78 -
.../juneau/http/classic/header/Range_Test.java | 78 -
.../juneau/http/classic/header/Referer_Test.java | 84 -
.../http/classic/header/RetryAfter_Test.java | 101 -
.../juneau/http/classic/header/Server_Test.java | 78 -
.../apache/juneau/http/classic/header/TE_Test.java | 84 -
.../juneau/http/classic/header/Trailer_Test.java | 78 -
.../http/classic/header/TransferEncoding_Test.java | 78 -
.../juneau/http/classic/header/Upgrade_Test.java | 82 -
.../juneau/http/classic/header/UserAgent_Test.java | 78 -
.../juneau/http/classic/header/Vary_Test.java | 78 -
.../juneau/http/classic/header/Via_Test.java | 83 -
.../juneau/http/classic/header/Warning_Test.java | 78 -
.../http/classic/header/WwwAuthenticate_Test.java | 78 -
.../http/classic/response/Accepted_Test.java | 55 -
.../classic/response/AlreadyReported_Test.java | 55 -
.../http/classic/response/BadRequest_Test.java | 136 -
.../http/classic/response/Conflict_Test.java | 90 -
.../http/classic/response/Continue_Test.java | 55 -
.../juneau/http/classic/response/Created_Test.java | 55 -
.../http/classic/response/EarlyHints_Test.java | 55 -
.../classic/response/ExpectationFailed_Test.java | 90 -
.../classic/response/FailedDependency_Test.java | 90 -
.../http/classic/response/Forbidden_Test.java | 90 -
.../juneau/http/classic/response/Found_Test.java | 60 -
.../juneau/http/classic/response/Gone_Test.java | 90 -
.../http/classic/response/HttpException_Test.java | 232 --
.../response/HttpVersionNotSupported_Test.java | 90 -
.../juneau/http/classic/response/IMUsed_Test.java | 55 -
.../classic/response/InsufficentStorage_Test.java | 90 -
.../classic/response/InternalServerError_Test.java | 90 -
.../http/classic/response/LengthRequired_Test.java | 90 -
.../juneau/http/classic/response/Locked_Test.java | 90 -
.../http/classic/response/LoopDetected_Test.java | 90 -
.../classic/response/MethodNotAllowed_Test.java | 90 -
.../classic/response/MisdirectedRequest_Test.java | 90 -
.../classic/response/MovedPermanently_Test.java | 60 -
.../http/classic/response/MultiStatus_Test.java | 55 -
.../classic/response/MultipleChoices_Test.java | 55 -
.../NetworkAuthenticationRequired_Test.java | 90 -
.../http/classic/response/NoContent_Test.java | 53 -
.../response/NonAuthoritativeInformation_Test.java | 55 -
.../http/classic/response/NotAcceptable_Test.java | 90 -
.../http/classic/response/NotExtended_Test.java | 90 -
.../http/classic/response/NotFound_Test.java | 90 -
.../http/classic/response/NotImplemented_Test.java | 90 -
.../http/classic/response/NotModified_Test.java | 53 -
.../juneau/http/classic/response/Ok_Test.java | 55 -
.../http/classic/response/PartialContent_Test.java | 55 -
.../classic/response/PayloadTooLarge_Test.java | 90 -
.../classic/response/PermanentRedirect_Test.java | 59 -
.../classic/response/PreconditionFailed_Test.java | 90 -
.../response/PreconditionRequired_Test.java | 90 -
.../http/classic/response/Processing_Test.java | 55 -
.../classic/response/RangeNotSatisfiable_Test.java | 90 -
.../response/RequestHeaderFieldsTooLarge_Test.java | 90 -
.../http/classic/response/ResetContent_Test.java | 53 -
.../http/classic/response/SeeOther_Test.java | 60 -
.../classic/response/ServiceUnavailable_Test.java | 90 -
.../classic/response/SwitchingProtocols_Test.java | 55 -
.../classic/response/TemporaryRedirect_Test.java | 60 -
.../classic/response/TooManyRequests_Test.java | 90 -
.../http/classic/response/Unauthorized_Test.java | 90 -
.../response/UnavailableForLegalReasons_Test.java | 90 -
.../classic/response/UnprocessableEntity_Test.java | 90 -
.../response/UnsupportedMediaType_Test.java | 90 -
.../classic/response/UpgradeRequired_Test.java | 90 -
.../http/classic/response/UriTooLong_Test.java | 90 -
.../http/classic/response/UseProxy_Test.java | 55 -
.../response/VariantAlsoNegotiates_Test.java | 90 -
.../http/remote/Remote_CommonInterfaces_Test.java | 864 ------
.../http/remote/Remote_ContentAnnotation_Test.java | 337 ---
.../remote/Remote_FormDataAnnotation_Test.java | 884 ------
.../http/remote/Remote_HeaderAnnotation_Test.java | 812 -----
.../Remote_MethodDefaultsAnnotation_Test.java | 382 ---
.../http/remote/Remote_PathAnnotation_Test.java | 721 -----
.../http/remote/Remote_QueryAnnotation_Test.java | 879 ------
.../remote/Remote_RemoteOpAnnotation_Test.java | 261 --
.../http/remote/Remote_RequestAnnotation_Test.java | 296 --
.../remote/Remote_ResponseAnnotation_Test.java | 138 -
.../org/apache/juneau/http/remote/Remote_Test.java | 712 -----
.../juneau/http/remote/RrpcInterface_Test.java | 1779 -----------
...sicHtmlDocTemplate_Navlink_RequestUri_Test.java | 59 -
.../juneau/marshall/html/HtmlDocConfig_Test.java | 673 -----
.../org/apache/juneau/marshall/sse/Sse_Test.java | 741 -----
.../marshall/yaml/YamlBufferUnderflow_Test.java | 184 --
.../rest/async/AsyncCompletionExecutor_Test.java | 328 --
.../juneau/rest/client/RemoteClient_Test.java | 790 -----
.../client/RemoteProxy_FeatureParity_Test.java | 846 ------
.../rest/client/RestClientFeatures_Test.java | 1604 ----------
.../apache/juneau/rest/client/RestClient_Test.java | 792 -----
.../classic/BasicHttpRequestRetryHandler_Test.java | 59 -
.../client/classic/RestCallException_Test.java | 84 -
.../client/classic/RestClient_BasicCalls_Test.java | 399 ---
.../rest/client/classic/RestClient_Body_Test.java | 189 --
.../classic/RestClient_CallbackStrings_Test.java | 72 -
.../classic/RestClient_Config_Context_Test.java | 136 -
.../RestClient_Config_MarshallingContext_Test.java | 993 -------
.../classic/RestClient_Config_OpenApi_Test.java | 89 -
.../classic/RestClient_Config_Parser_Test.java | 67 -
.../classic/RestClient_Config_RestClient_Test.java | 514 ----
.../classic/RestClient_Config_Serializer_Test.java | 228 --
.../client/classic/RestClient_FormData_Test.java | 175 --
.../client/classic/RestClient_Headers_Test.java | 243 --
.../RestClient_Logging_StreamClosed_Test.java | 248 --
.../client/classic/RestClient_Logging_Test.java | 235 --
.../client/classic/RestClient_Marshalls_Test.java | 186 --
.../rest/client/classic/RestClient_Paths_Test.java | 98 -
.../rest/client/classic/RestClient_Query_Test.java | 151 -
.../classic/RestClient_Response_Body_Test.java | 357 ---
.../classic/RestClient_Response_Headers_Test.java | 203 --
.../client/classic/RestClient_Response_Test.java | 248 --
.../rest/client/classic/RestClient_Test.java | 435 ---
.../rest/mixin/MixinContext_BeanStore_Test.java | 83 -
.../rest/mixin/MixinContext_Construction_Test.java | 105 -
.../rest/mixin/MixinHooks_DestroyOrder_Test.java | 79 -
.../rest/mixin/MixinHooks_DualFire_Test.java | 86 -
.../mixin/MixinInheritance_CallLogger_Test.java | 122 -
.../mixin/MixinInheritance_Converters_Test.java | 103 -
.../mixin/MixinInheritance_DebugDefault_Test.java | 88 -
.../MixinInheritance_DebugEnablement_Test.java | 105 -
.../rest/mixin/MixinInheritance_Encoders_Test.java | 129 -
.../rest/mixin/MixinInheritance_Guards_Test.java | 103 -
.../rest/mixin/MixinInheritance_Messages_Test.java | 141 -
.../mixin/MixinInheritance_NoInherit_Test.java | 91 -
.../rest/mixin/MixinInheritance_Parsers_Test.java | 123 -
.../mixin/MixinInheritance_PartParser_Test.java | 121 -
.../MixinInheritance_PartSerializer_Test.java | 121 -
.../MixinInheritance_ResponseProcessors_Test.java | 129 -
.../mixin/MixinInheritance_RestOpArgs_Test.java | 130 -
.../mixin/MixinInheritance_Serializers_Test.java | 103 -
.../mixin/MixinInheritance_VarResolver_Test.java | 63 -
.../mixin/MixinRouting_HostUnaffected_Test.java | 62 -
.../RestObservabilityAttributes_Test.java | 257 --
.../observability/RestObservabilitySvl_Test.java | 134 -
.../rest/server/AbstractRestBuilder_Test.java | 463 ---
...BasicRestServletGroup_DynamicChildren_Test.java | 519 ----
.../apache/juneau/rest/server/Content_Test.java | 991 -------
.../apache/juneau/rest/server/FormData_Test.java | 321 --
.../juneau/rest/server/HasFormData_Test.java | 55 -
.../apache/juneau/rest/server/HasQuery_Test.java | 77 -
.../rest/server/Header_AcceptCharset_Test.java | 91 -
.../rest/server/Header_AcceptEncoding_Test.java | 252 --
.../juneau/rest/server/Header_Accept_Test.java | 250 --
.../rest/server/Header_ContentType_Test.java | 213 --
.../org/apache/juneau/rest/server/Header_Test.java | 319 --
.../juneau/rest/server/LazyChildren_Test.java | 304 --
.../rest/server/MarshalledConfig_Swaps_Test.java | 133 -
.../org/apache/juneau/rest/server/Nls_Test.java | 102 -
.../apache/juneau/rest/server/NoInherit_Test.java | 248 --
.../rest/server/OpSwaggerAnnotation_Test.java | 133 -
.../juneau/rest/server/PathRemainder_Test.java | 289 --
.../org/apache/juneau/rest/server/Path_Test.java | 880 ------
.../org/apache/juneau/rest/server/Paths_Test.java | 612 ----
.../juneau/rest/server/ProblemMapper_Test.java | 354 ---
.../org/apache/juneau/rest/server/Query_Test.java | 486 ---
.../juneau/rest/server/ResponseHeader_Test.java | 251 --
.../juneau/rest/server/ResponseStatus_Test.java | 44 -
.../apache/juneau/rest/server/Response_Test.java | 349 ---
.../juneau/rest/server/RestAnnotation_Test.java | 274 --
.../juneau/rest/server/RestBuilder_Test.java | 163 -
.../RestContext_Args_OverridingParent_Test.java | 119 -
.../rest/server/RestContext_Builder_Test.java | 109 -
.../server/RestContext_Getters_Coverage_Test.java | 295 --
.../rest/server/RestContext_Precedence_Test.java | 235 --
.../server/RestContext_ValueAdoption_Test.java | 242 --
.../RestContext_ValueAgainstConfig_Test.java | 375 ---
.../rest/server/RestDeleteAnnotation_Test.java | 182 --
.../rest/server/RestDestroyAnnotation_Test.java | 97 -
.../rest/server/RestEndCallAnnotation_Test.java | 97 -
.../rest/server/RestEtag_RoundTrip_Test.java | 117 -
.../juneau/rest/server/RestGetAnnotation_Test.java | 196 --
.../rest/server/RestInitAnnotation_Test.java | 100 -
.../apache/juneau/rest/server/RestInit_Test.java | 111 -
.../rest/server/RestInjectAnnotation_Test.java | 136 -
.../juneau/rest/server/RestOpAnnotation_Test.java | 221 --
.../RestOpContext_HttpMethodResolution_Test.java | 119 -
.../RestOpContext_OpLevelOverrides_Test.java | 88 -
...estOpContext_PathMatcher_CompiledForm_Test.java | 93 -
.../server/RestOpContext_SvlInOpPath_Test.java | 189 --
.../juneau/rest/server/RestOpInvoker_Test.java | 711 -----
.../rest/server/RestOp_ClientVersion_Test.java | 196 --
.../juneau/rest/server/RestOp_Guards_Test.java | 208 --
.../rest/server/RestOp_MarshalledConfig_Test.java | 297 --
.../juneau/rest/server/RestOp_Matchers_Test.java | 84 -
.../juneau/rest/server/RestOp_Params_Test.java | 379 ---
.../juneau/rest/server/RestOp_ReqHeaders_Test.java | 118 -
.../juneau/rest/server/RestOp_Returns_Test.java | 181 --
.../juneau/rest/server/RestOp_Throws_Test.java | 879 ------
.../rest/server/RestOptionsAnnotation_Test.java | 215 --
.../rest/server/RestPatchAnnotation_Test.java | 236 --
.../RestPathsRuntimeOverride_CommaSplit_Test.java | 175 --
...RestPathsRuntimeOverride_GetterShapes_Test.java | 343 ---
.../RestPathsRuntimeOverride_Getter_Test.java | 112 -
...RestPathsRuntimeOverride_Programmatic_Test.java | 82 -
.../server/RestPathsRuntimeOverride_SVL_Test.java | 213 --
.../rest/server/RestPostAnnotation_Test.java | 217 --
.../rest/server/RestPostCallAnnotation_Test.java | 97 -
.../juneau/rest/server/RestPostCall_Test.java | 80 -
.../rest/server/RestPostInitAnnotation_Test.java | 101 -
.../juneau/rest/server/RestPostInit_Test.java | 211 --
.../rest/server/RestPreCallAnnotation_Test.java | 97 -
.../juneau/rest/server/RestPreCall_Test.java | 82 -
.../juneau/rest/server/RestPutAnnotation_Test.java | 217 --
.../RestRequest_CheckPreconditions_Test.java | 337 ---
.../rest/server/RestRequest_Coverage_Test.java | 502 ----
.../server/RestRequest_SessionProperties_Test.java | 160 -
.../rest/server/RestResponse_DownloadAs_Test.java | 47 -
.../rest/server/RestResponse_EtagHelpers_Test.java | 368 ---
.../server/RestResponse_SetSerializer_Test.java | 73 -
.../juneau/rest/server/RestResponse_Test.java | 697 -----
.../rest/server/RestStartCallAnnotation_Test.java | 97 -
.../juneau/rest/server/RestStartCall_Test.java | 81 -
.../rest/server/Rest_AllowContentParam_Test.java | 71 -
.../rest/server/Rest_AllowedHeaderParams_Test.java | 108 -
.../server/Rest_AllowedMethodHeaders_Test.java | 132 -
.../rest/server/Rest_AllowedMethodParams_Test.java | 195 --
.../server/Rest_AnnotationInheritance_Test.java | 63 -
.../server/Rest_BeanCreatorOverrides_Test.java | 150 -
.../apache/juneau/rest/server/Rest_Debug_Test.java | 155 -
.../server/Rest_DefaultRequestAttributes_Test.java | 185 --
.../juneau/rest/server/Rest_Encoders_Test.java | 96 -
.../juneau/rest/server/Rest_Messages_Test.java | 131 -
.../rest/server/Rest_Mixins_Conflicts_Test.java | 51 -
.../juneau/rest/server/Rest_Mixins_Test.java | 81 -
.../server/Rest_PredefinedStatusCodes_Test.java | 238 --
.../server/Rest_ProblemDetails_OptIn_Test.java | 152 -
.../server/Rest_ProblemDetails_PerOp_Test.java | 324 --
.../apache/juneau/rest/server/Rest_RVars_Test.java | 83 -
.../rest/server/Rest_SseBroadcaster_IT_Test.java | 55 -
.../juneau/rest/server/Restx_Parsers_Test.java | 185 --
.../apache/juneau/rest/server/Restx_Path_Test.java | 147 -
.../juneau/rest/server/Restx_ReqAttrs_Test.java | 167 --
.../juneau/rest/server/Restx_RoleGuard_Test.java | 1018 -------
.../juneau/rest/server/Restx_Serializers_Test.java | 178 --
.../rest/server/Settings_NoLeakedSources_Test.java | 137 -
.../StackOverlay_RestContext_Spike_Test.java | 203 --
.../juneau/rest/server/SwaggerAnnotation_Test.java | 123 -
.../juneau/rest/server/Swagger_Body_Test.java | 245 --
.../juneau/rest/server/Swagger_FormData_Test.java | 234 --
.../juneau/rest/server/Swagger_Header_Test.java | 227 --
.../juneau/rest/server/Swagger_Path_Test.java | 278 --
.../juneau/rest/server/Swagger_Query_Test.java | 202 --
.../juneau/rest/server/Swagger_Response_Test.java | 347 ---
.../rest/server/Swagger_RestOp_Parameters.java | 233 --
.../apache/juneau/rest/server/Swagger_Test.java | 1875 ------------
.../rest/server/VirtualThreadDispatch_Test.java | 230 --
.../juneau/rest/server/arg/ArgException_Test.java | 88 -
.../server/assertions/RestAssertions_Test.java | 364 ---
.../juneau/rest/server/auth/ApiKeyGuard_Test.java | 317 --
.../juneau/rest/server/auth/AuthArg_Test.java | 170 --
.../AuthFilterChain_GuardIntegration_Test.java | 256 --
.../juneau/rest/server/auth/AuthFilter_Test.java | 258 --
.../rest/server/auth/BearerTokenGuard_Test.java | 257 --
.../rest/server/beans/BeanDescription_Test.java | 114 -
.../beans/ChildResourceDescriptions_Test.java | 91 -
.../juneau/rest/server/beans/Hyperlink_Test.java | 67 -
.../server/beans/ResourceDescription_Test.java | 32 -
.../rest/server/beans/SeeOtherRoot_Test.java | 80 -
.../convention/BasicConvention_Builders_Test.java | 370 ---
.../BasicConvention_OpenApiHidden_Test.java | 108 -
.../BasicConvention_ParentChain_Test.java | 141 -
.../convention/FaviconMixin_AsMixin_Test.java | 141 -
.../server/convention/FaviconResource_Test.java | 70 -
.../server/convention/FaviconServlet_Test.java | 92 -
.../server/convention/SeoMixin_AsMixin_Test.java | 130 -
.../convention/VersionMixin_AsMixin_Test.java | 154 -
.../VersionMixin_SvlPathOverride_Test.java | 186 --
.../VersionMixin_ValueAdoption_Test.java | 76 -
.../server/convention/VersionResource_Test.java | 72 -
.../server/convention/VersionServlet_Test.java | 83 -
.../convention/WellKnownMixin_AsMixin_Test.java | 82 -
.../rest/server/converter/RestConverter_Test.java | 211 --
.../juneau/rest/server/debug/DebugConfig_Test.java | 359 ---
.../rest/server/debug/DebugEnablement_Test.java | 487 ---
.../juneau/rest/server/debug/DebugRule_Test.java | 169 --
.../rest/server/docs/BasicApiDocsTestFixtures.java | 150 -
.../server/docs/BasicApiDocs_ParentChain_Test.java | 102 -
.../docs/BasicApiDocs_TransitiveDedupe_Test.java | 109 -
.../server/docs/OpenApiMixin_AsMixin_Test.java | 96 -
.../docs/OpenApiMixin_SvlPathOverride_Test.java | 188 --
.../rest/server/docs/RedocMixin_AsMixin_Test.java | 98 -
.../docs/RedocMixin_SvlPathOverride_Test.java | 174 --
.../server/docs/SwaggerMixin_AsMixin_Test.java | 75 -
.../server/docs/SwaggerMixin_Standalone_Test.java | 62 -
.../docs/SwaggerMixin_SvlPathOverride_Test.java | 178 --
.../server/docs/SwaggerUiMixin_AsMixin_Test.java | 86 -
.../docs/SwaggerUiMixin_SvlPathOverride_Test.java | 175 --
.../server/filter/RequestIdFilter_Echo_Test.java | 61 -
.../server/filter/RequestIdFilter_Honor_Test.java | 61 -
.../filter/RequestIdFilter_Malformed_Test.java | 175 --
.../rest/server/filter/RequestIdFilter_Test.java | 108 -
.../guard/RateLimitGuard_AdvisoryHeaders_Test.java | 91 -
.../server/guard/RateLimitGuard_Eviction_Test.java | 117 -
.../guard/RateLimitGuard_ExemptPaths_Test.java | 126 -
.../guard/RateLimitGuard_KeyIsolation_Test.java | 96 -
.../server/guard/RateLimitGuard_Snapshot_Test.java | 177 --
.../rest/server/guard/RateLimitGuard_Test.java | 198 --
.../guard/RateLimitGuard_XForwardedFor_Test.java | 102 -
.../juneau/rest/server/guard/RoleMatcher_Test.java | 300 --
.../rest/server/health/HealthIndicator_Test.java | 45 -
.../rest/server/health/HealthMixin_Test.java | 64 -
.../rest/server/health/HealthResource_Test.java | 97 -
.../rest/server/health/HealthServlet_Test.java | 72 -
.../server/httppart/RequestAttributes_Test.java | 219 --
.../server/httppart/RequestFormParamList_Test.java | 457 ---
.../RequestHttpPart_FluentSetters_Test.java | 93 -
.../server/httppart/RequestPathParamList_Test.java | 452 ---
.../httppart/RequestQueryParamList_Test.java | 471 ---
.../logger/CallLogger_ValueAdoption_Test.java | 163 -
.../openapi/BasicOpenApiProviderSession_Test.java | 737 -----
.../server/openapi/OpenApiSchemaReuse_Test.java | 185 --
.../server/openapi/OpenApiYamlRoundTrip_Test.java | 158 -
.../rest/server/ops/AdminMixin_AsMixin_Test.java | 340 ---
.../ops/AdminMixin_AuthIntegration_Test.java | 142 -
.../ops/AdminMixin_RateLimitSnapshot_Test.java | 259 --
.../ops/AdminMixin_SvlPathOverride_Test.java | 195 --
.../juneau/rest/server/ops/AdminResource_Test.java | 92 -
.../juneau/rest/server/ops/AdminServlet_Test.java | 130 -
.../server/ops/BasicOps_OpenApiHidden_Test.java | 105 -
.../rest/server/ops/BasicOps_ParentChain_Test.java | 127 -
.../rest/server/ops/EchoMixin_AsMixin_Test.java | 330 ---
.../server/ops/EchoMixin_SvlPathOverride_Test.java | 208 --
.../server/ops/MixinHtmlDocInheritance_Test.java | 168 --
.../server/ops/NavigationMixin_AsMixin_Test.java | 65 -
.../server/ops/RouteIndexMixin_AsMixin_Test.java | 236 --
.../RouteIndexMixin_ContentNegotiation_Test.java | 104 -
.../ops/RouteIndexMixin_SvlPathOverride_Test.java | 194 --
.../processor/AsyncResponseProcessor_Test.java | 384 ---
.../processor/CatchAllResponseProcessor_Test.java | 103 -
.../server/processor/MdcAsyncListener_Test.java | 217 --
.../processor/ProblemDetailsProcessor_Test.java | 210 --
.../processor/ResponseBeanProcessor_Test.java | 455 ---
.../rest/server/remote/RrpcServlet_Test.java | 193 --
.../rest/server/rrpc/RrpcRestOpSession_Test.java | 54 -
...JuneauRestServletContainerInitializer_Test.java | 85 -
.../server/servlet/RestMixin_HostContext_Test.java | 107 -
.../rest/server/servlet/RestServlet_Test.java | 381 ---
.../rest/server/sse/SseBroadcaster_Test.java | 59 -
.../juneau/rest/server/sse/SseHeartbeat_Test.java | 45 -
.../rest/server/sse/SseResponseSupport_Test.java | 55 -
.../staticfile/StaticFilesMixin_AsMixin_Test.java | 110 -
.../StaticFilesMixin_CacheControl_Test.java | 80 -
.../StaticFilesMixin_ImporterOverride_Test.java | 77 -
.../StaticFilesMixin_OpenApiHidden_Test.java | 134 -
.../StaticFilesMixin_Standalone_Test.java | 73 -
.../StaticFilesMixin_SvlPathOverride_Test.java | 205 --
.../staticfile/StaticFilesResource_Test.java | 74 -
.../server/staticfile/StaticFilesServlet_Test.java | 80 -
.../BasicSwaggerProviderSession_Coverage_Test.java | 574 ----
.../util/BoundedServletInputStream_Test.java | 261 --
.../juneau/rest/server/util/RestUtils_Test.java | 470 ---
.../rest/server/util/UrlPathMatcher_Test.java | 360 ---
.../rest/server/vars/RequestSwaggerVar_Test.java | 408 ---
.../juneau/rest/server/vars/RestVars_Test.java | 290 --
.../rest/server/widget/MenuItemWidget_Test.java | 398 ---
.../juneau/rest/server/widget/RestWidget_Test.java | 229 --
.../rest/test/client/ThirdPartyProxyResource.java | 1771 -----------
.../rest/test/client/ThirdPartyProxy_Test.java | 2524 ----------------
.../juneau/rest/validation/BeanValidator_Test.java | 144 -
.../validation/RestValidation_Content_Test.java | 244 --
.../RestValidation_CustomValidator_Test.java | 111 -
.../RestValidation_MissingProvider_Test.java | 96 -
.../validation/RestValidation_Nested_Test.java | 142 -
.../RestValidation_OffByDefault_Test.java | 152 -
.../RestValidation_ProblemDetails_Test.java | 129 -
.../org/apache/juneau/testutils/pojos/ABean.java | 36 -
.../testutils/pojos/ImplicitSwappedObject.java | 38 -
.../juneau/testutils/pojos/SwappedObject.java | 29 -
.../juneau/testutils/pojos/SwappedObjectSwap.java | 40 -
.../org/apache/juneau/testutils/pojos/TestURI.java | 69 -
.../apache/juneau/testutils/pojos/TypedBean.java | 21 -
.../juneau/testutils/pojos/TypedBeanImpl.java | 38 -
.../org/apache/juneau/testutils/pojos/XBeans.java | 270 --
.../juneau/utest/utils/FakeReaderParser.java | 112 -
.../juneau/utest/utils/FakeStreamParser.java | 85 -
.../juneau/utest/utils/FakeStreamSerializer.java | 91 -
.../juneau/utest/utils/FakeWriterSerializer.java | 139 -
.../beans/factory/annotation/Autowired.java | 39 -
juneau-utest/README.md | 6 +-
juneau-utest/perf-baseline.txt | 41 -
juneau-utest/pom.xml | 5 +
.../juneau/CloseableByteArrayInputStream.java | 42 -
.../org/apache/juneau/CloseableStringReader.java | 52 -
.../src/test/java/org/apache/juneau/TestBase.java | 31 -
.../src/test/java/org/apache/juneau/XVar.java | 44 -
.../juneau/assertions/AnyAssertion_Test.java | 517 ----
.../juneau/assertions/ArrayAssertion_Test.java | 453 ---
.../assertions/AssertionPredicates_Test.java | 163 -
.../apache/juneau/assertions/Assertion_Test.java | 93 -
.../apache/juneau/assertions/Assertions_Test.java | 162 -
.../juneau/assertions/BeanAssertion_Test.java | 306 --
.../juneau/assertions/BeanListAssertion_Test.java | 429 ---
.../juneau/assertions/BooleanAssertion_Test.java | 284 --
.../juneau/assertions/ByteArrayAssertion_Test.java | 321 --
.../assertions/CollectionAssertion_Test.java | 353 ---
.../assertions/ComparableAssertion_Test.java | 341 ---
.../juneau/assertions/DateAssertion_Test.java | 421 ---
.../juneau/assertions/IntegerAssertion_Test.java | 340 ---
.../juneau/assertions/ListAssertion_Test.java | 472 ---
.../juneau/assertions/LongAssertion_Test.java | 342 ---
.../juneau/assertions/MapAssertion_Test.java | 351 ---
.../juneau/assertions/ObjectAssertion_Test.java | 299 --
.../assertions/PrimitiveArrayAssertion_Test.java | 359 ---
.../juneau/assertions/StringAssertion_Test.java | 517 ----
.../assertions/StringListAssertion_Test.java | 426 ---
.../juneau/assertions/ThrowableAssertion_Test.java | 364 ---
.../org/apache/juneau/assertions/Verify_Test.java | 76 -
.../juneau/assertions/VersionAssertion_Test.java | 371 ---
.../assertions/ZonedDateTimeAssertion_Test.java | 406 ---
.../java/org/apache/juneau/bean/atom/AtomTest.java | 365 ---
.../org/apache/juneau/bean/atom/Content_Test.java | 88 -
.../apache/juneau/bean/common/LinkString_Test.java | 102 -
.../juneau/bean/common/ResultSetList_Test.java | 256 --
.../apache/juneau/bean/hal/Hal_RoundTrip_Test.java | 350 ---
.../java/org/apache/juneau/bean/html5/A_Test.java | 115 -
.../org/apache/juneau/bean/html5/Abbr_Test.java | 108 -
.../org/apache/juneau/bean/html5/Address_Test.java | 108 -
.../org/apache/juneau/bean/html5/Area_Test.java | 116 -
.../org/apache/juneau/bean/html5/Article_Test.java | 112 -
.../org/apache/juneau/bean/html5/Aside_Test.java | 108 -
.../org/apache/juneau/bean/html5/Audio_Test.java | 148 -
.../java/org/apache/juneau/bean/html5/B_Test.java | 108 -
.../org/apache/juneau/bean/html5/Base_Test.java | 109 -
.../org/apache/juneau/bean/html5/Bdi_Test.java | 108 -
.../org/apache/juneau/bean/html5/Bdo_Test.java | 108 -
.../apache/juneau/bean/html5/Blockquote_Test.java | 109 -
.../org/apache/juneau/bean/html5/Body_Test.java | 114 -
.../java/org/apache/juneau/bean/html5/Br_Test.java | 101 -
.../org/apache/juneau/bean/html5/Button_Test.java | 123 -
.../org/apache/juneau/bean/html5/Canvas_Test.java | 129 -
.../org/apache/juneau/bean/html5/Caption_Test.java | 108 -
.../org/apache/juneau/bean/html5/Cite_Test.java | 108 -
.../org/apache/juneau/bean/html5/Code_Test.java | 108 -
.../org/apache/juneau/bean/html5/Col_Test.java | 108 -
.../apache/juneau/bean/html5/Colgroup_Test.java | 110 -
.../org/apache/juneau/bean/html5/Data_Test.java | 109 -
.../apache/juneau/bean/html5/Datalist_Test.java | 109 -
.../java/org/apache/juneau/bean/html5/Dd_Test.java | 108 -
.../org/apache/juneau/bean/html5/Del_Test.java | 110 -
.../org/apache/juneau/bean/html5/Dfn_Test.java | 108 -
.../org/apache/juneau/bean/html5/Div_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/Dl_Test.java | 109 -
.../java/org/apache/juneau/bean/html5/Dt_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/Em_Test.java | 108 -
.../org/apache/juneau/bean/html5/Embed_Test.java | 111 -
.../apache/juneau/bean/html5/Fieldset_Test.java | 111 -
.../apache/juneau/bean/html5/Figcaption_Test.java | 108 -
.../org/apache/juneau/bean/html5/Figure_Test.java | 109 -
.../org/apache/juneau/bean/html5/Footer_Test.java | 108 -
.../org/apache/juneau/bean/html5/Form_Test.java | 119 -
.../java/org/apache/juneau/bean/html5/H1_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/H2_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/H3_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/H4_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/H5_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/H6_Test.java | 108 -
.../org/apache/juneau/bean/html5/Head_Test.java | 108 -
.../org/apache/juneau/bean/html5/Header_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/Hr_Test.java | 101 -
.../apache/juneau/bean/html5/Html5BasicTest.java | 41 -
.../html5/Html5Template_ComboRoundTripTest.java | 96 -
.../bean/html5/Html5_ComboRoundTripTest.java | 2247 --------------
.../apache/juneau/bean/html5/HtmlBuilder_Test.java | 193 --
.../bean/html5/HtmlElementContainer_Test.java | 152 -
.../juneau/bean/html5/HtmlElementMixed_Test.java | 152 -
.../juneau/bean/html5/HtmlElement_Attr_Test.java | 265 --
.../apache/juneau/bean/html5/HtmlText_Test.java | 36 -
.../org/apache/juneau/bean/html5/Html_Test.java | 110 -
.../java/org/apache/juneau/bean/html5/I_Test.java | 108 -
.../org/apache/juneau/bean/html5/Iframe_Test.java | 114 -
.../org/apache/juneau/bean/html5/Img_Test.java | 114 -
.../org/apache/juneau/bean/html5/Input_Test.java | 147 -
.../org/apache/juneau/bean/html5/Ins_Test.java | 110 -
.../org/apache/juneau/bean/html5/Kbd_Test.java | 108 -
.../org/apache/juneau/bean/html5/Keygen_Test.java | 107 -
.../org/apache/juneau/bean/html5/Label_Test.java | 110 -
.../org/apache/juneau/bean/html5/Legend_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/Li_Test.java | 108 -
.../org/apache/juneau/bean/html5/Link_Test.java | 119 -
.../org/apache/juneau/bean/html5/Main_Test.java | 109 -
.../org/apache/juneau/bean/html5/Map_Test.java | 110 -
.../org/apache/juneau/bean/html5/Mark_Test.java | 108 -
.../org/apache/juneau/bean/html5/Meta_Test.java | 105 -
.../org/apache/juneau/bean/html5/Meter_Test.java | 114 -
.../org/apache/juneau/bean/html5/Nav_Test.java | 108 -
.../apache/juneau/bean/html5/Noscript_Test.java | 108 -
.../org/apache/juneau/bean/html5/Object__Test.java | 116 -
.../java/org/apache/juneau/bean/html5/Ol_Test.java | 112 -
.../apache/juneau/bean/html5/Optgroup_Test.java | 111 -
.../org/apache/juneau/bean/html5/Option_Test.java | 115 -
.../org/apache/juneau/bean/html5/Output_Test.java | 111 -
.../java/org/apache/juneau/bean/html5/P_Test.java | 108 -
.../org/apache/juneau/bean/html5/Param_Test.java | 109 -
.../org/apache/juneau/bean/html5/Pre_Test.java | 108 -
.../apache/juneau/bean/html5/Progress_Test.java | 110 -
.../java/org/apache/juneau/bean/html5/Q_Test.java | 109 -
.../java/org/apache/juneau/bean/html5/Rb_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/Rp_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/Rt_Test.java | 108 -
.../org/apache/juneau/bean/html5/Rtc_Test.java | 108 -
.../org/apache/juneau/bean/html5/Ruby_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/S_Test.java | 108 -
.../org/apache/juneau/bean/html5/Samp_Test.java | 108 -
.../org/apache/juneau/bean/html5/Script_Test.java | 114 -
.../org/apache/juneau/bean/html5/Section_Test.java | 108 -
.../org/apache/juneau/bean/html5/Select_Test.java | 154 -
.../org/apache/juneau/bean/html5/Small_Test.java | 108 -
.../org/apache/juneau/bean/html5/Source_Test.java | 109 -
.../org/apache/juneau/bean/html5/Span_Test.java | 108 -
.../org/apache/juneau/bean/html5/Strong_Test.java | 108 -
.../org/apache/juneau/bean/html5/Style_Test.java | 113 -
.../org/apache/juneau/bean/html5/Sub_Test.java | 108 -
.../org/apache/juneau/bean/html5/Sup_Test.java | 108 -
.../org/apache/juneau/bean/html5/Table_Test.java | 109 -
.../org/apache/juneau/bean/html5/Tbody_Test.java | 109 -
.../java/org/apache/juneau/bean/html5/Td_Test.java | 111 -
.../apache/juneau/bean/html5/Template_Test.java | 108 -
.../apache/juneau/bean/html5/Textarea_Test.java | 123 -
.../org/apache/juneau/bean/html5/Tfoot_Test.java | 109 -
.../java/org/apache/juneau/bean/html5/Th_Test.java | 114 -
.../org/apache/juneau/bean/html5/Thead_Test.java | 109 -
.../org/apache/juneau/bean/html5/Time_Test.java | 109 -
.../org/apache/juneau/bean/html5/Title_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/Tr_Test.java | 109 -
.../org/apache/juneau/bean/html5/Track_Test.java | 112 -
.../java/org/apache/juneau/bean/html5/U_Test.java | 108 -
.../java/org/apache/juneau/bean/html5/Ul_Test.java | 109 -
.../org/apache/juneau/bean/html5/Var_Test.java | 108 -
.../org/apache/juneau/bean/html5/Video_Test.java | 120 -
.../org/apache/juneau/bean/html5/Wbr_Test.java | 101 -
.../bean/jsonapi/JsonApi_RoundTrip_Test.java | 445 ---
.../bean/jsonpatch/JsonPatch_RoundTrip_Test.java | 236 --
.../jsonschema/JsonSchemaBeanGenerator_Test.java | 206 --
.../juneau/bean/jsonschema/JsonSchemaMap_Test.java | 121 -
.../JsonSchemaPropertySimpleArray_Test.java | 348 ---
.../JsonSchemaPropertyValidatorFactory_Test.java | 75 -
.../bean/jsonschema/JsonSchemaProperty_Test.java | 382 ---
.../juneau/bean/jsonschema/JsonSchemaRef_Test.java | 381 ---
.../bean/jsonschema/JsonSchemaValidator_Test.java | 484 ---
.../juneau/bean/jsonschema/JsonType_Test.java | 92 -
.../juneau/bean/mcp/McpBeans_RoundTrip_Test.java | 274 --
.../apache/juneau/bean/openapi3/Callback_Test.java | 243 --
.../juneau/bean/openapi3/Components_Test.java | 237 --
.../apache/juneau/bean/openapi3/Contact_Test.java | 225 --
.../juneau/bean/openapi3/Discriminator_Test.java | 238 --
.../apache/juneau/bean/openapi3/Encoding_Test.java | 244 --
.../apache/juneau/bean/openapi3/Example_Test.java | 225 --
.../bean/openapi3/ExternalDocumentation_Test.java | 238 --
.../juneau/bean/openapi3/HeaderInfo_Test.java | 345 ---
.../org/apache/juneau/bean/openapi3/Info_Test.java | 231 --
.../apache/juneau/bean/openapi3/Items_Test.java | 526 ----
.../apache/juneau/bean/openapi3/License_Test.java | 223 --
.../org/apache/juneau/bean/openapi3/Link_Test.java | 248 --
.../juneau/bean/openapi3/MediaType_Test.java | 247 --
.../juneau/bean/openapi3/OAuthFlow_Test.java | 268 --
.../juneau/bean/openapi3/OAuthFlows_Test.java | 225 --
.../juneau/bean/openapi3/OpenApiBuilder_Test.java | 148 -
.../juneau/bean/openapi3/OpenApiElement_Test.java | 71 -
.../apache/juneau/bean/openapi3/OpenApi_Test.java | 349 ---
.../juneau/bean/openapi3/Operation_Test.java | 397 ---
.../juneau/bean/openapi3/Parameter_Test.java | 266 --
.../apache/juneau/bean/openapi3/PathItem_Test.java | 240 --
.../juneau/bean/openapi3/RequestBodyInfo_Test.java | 241 --
.../apache/juneau/bean/openapi3/Response_Test.java | 339 ---
.../juneau/bean/openapi3/SchemaInfo_Test.java | 457 ---
.../bean/openapi3/SecurityRequirement_Test.java | 247 --
.../bean/openapi3/SecuritySchemeInfo_Test.java | 248 --
.../juneau/bean/openapi3/ServerVariable_Test.java | 247 --
.../apache/juneau/bean/openapi3/Server_Test.java | 242 --
.../org/apache/juneau/bean/openapi3/Tag_Test.java | 225 --
.../org/apache/juneau/bean/openapi3/Xml_Test.java | 227 --
.../juneau/bean/openapi3/ui/OpenApiUI_Test.java | 567 ----
.../juneau/bean/openapi3/ui/RedocUI_Test.java | 215 --
.../juneau/bean/rfc7807/ProblemException_Test.java | 101 -
.../apache/juneau/bean/swagger/Contact_Test.java | 229 --
.../bean/swagger/ExternalDocumentation_Test.java | 225 --
.../juneau/bean/swagger/HeaderInfo_Test.java | 403 ---
.../org/apache/juneau/bean/swagger/Info_Test.java | 234 --
.../org/apache/juneau/bean/swagger/Items_Test.java | 355 ---
.../apache/juneau/bean/swagger/License_Test.java | 223 --
.../juneau/bean/swagger/OperationMap_Test.java | 186 --
.../apache/juneau/bean/swagger/Operation_Test.java | 460 ---
.../juneau/bean/swagger/ParameterInfo_Test.java | 500 ----
.../juneau/bean/swagger/ResponseInfo_Test.java | 334 ---
.../juneau/bean/swagger/SchemaInfo_Test.java | 435 ---
.../juneau/bean/swagger/SecurityScheme_Test.java | 264 --
.../juneau/bean/swagger/SwaggerBuilder_Test.java | 190 --
.../apache/juneau/bean/swagger/Swagger_Test.java | 501 ----
.../org/apache/juneau/bean/swagger/Tag_Test.java | 227 --
.../org/apache/juneau/bean/swagger/Xml_Test.java | 229 --
.../juneau/bean/swagger/ui/SwaggerUI_Test.java | 586 ----
.../apache/juneau/config/ConfigBuilder_Test.java | 94 -
.../org/apache/juneau/config/ConfigEvent_Test.java | 122 -
.../apache/juneau/config/ConfigEvents_Test.java | 82 -
.../apache/juneau/config/ConfigImportsTest.java | 405 ---
.../apache/juneau/config/ConfigInterfaceTest.java | 539 ----
.../juneau/config/ConfigMapListener_Test.java | 576 ----
.../org/apache/juneau/config/ConfigMap_Test.java | 1093 -------
.../config/ConfigPropertySourceProvider_Test.java | 176 --
.../juneau/config/ConfigPropertySource_Test.java | 72 -
.../juneau/config/ConfigYamlFormat_Test.java | 344 ---
.../java/org/apache/juneau/config/Config_Test.java | 2123 -------------
.../org/apache/juneau/config/mod/Mod_Test.java | 164 -
.../config/store/ConfigClasspathStore_Test.java | 175 --
.../juneau/config/store/ConfigFileStoreTest.java | 303 --
.../config/store/ConfigMemoryStore_Test.java | 144 -
.../apache/juneau/http/AnnotationUtils_Test.java | 305 --
.../apache/juneau/http/ContactAnnotation_Test.java | 94 -
.../juneau/http/HttpFactoryFacades_Test.java | 124 -
.../org/apache/juneau/http/HttpMethod_Test.java | 41 -
.../org/apache/juneau/http/HttpParts_Test.java | 324 --
.../juneau/http/HttpProtocolVersion_Test.java | 99 -
.../java/org/apache/juneau/http/Http_Test.java | 769 -----
.../apache/juneau/http/LicenseAnnotation_Test.java | 94 -
.../juneau/http/MediaRanges_FindMatch_Test.java | 195 --
.../org/apache/juneau/http/MediaRanges_Test.java | 152 -
.../org/apache/juneau/http/MediaType_Test.java | 80 -
.../juneau/http/ResponseAnnotation_Test.java | 100 -
.../org/apache/juneau/http/StringRange_Test.java | 70 -
.../org/apache/juneau/http/StringRanges_Test.java | 63 -
.../org/apache/juneau/http/TagAnnotation_Test.java | 95 -
.../juneau/http/classic/BasicHeader_Test.java | 165 --
.../http/classic/BasicHttpResource_Test.java | 243 --
.../apache/juneau/http/classic/BasicPart_Test.java | 229 --
.../juneau/http/classic/BasicStatusLine_Test.java | 159 -
.../juneau/http/classic/HttpEntities_Test.java | 275 --
.../juneau/http/classic/HttpHeaders_Test.java | 93 -
.../apache/juneau/http/classic/HttpParts_Test.java | 519 ----
.../juneau/http/classic/HttpResources_Test.java | 229 --
.../juneau/http/classic/SerializedHeader_Test.java | 103 -
.../juneau/http/classic/SerializedPart_Test.java | 104 -
.../http/classic/entity/ByteArrayEntity_Test.java | 134 -
.../http/classic/entity/FileEntity_Test.java | 193 --
.../http/classic/entity/ReaderEntity_Test.java | 207 --
.../http/classic/entity/SerializedEntity_Test.java | 187 --
.../http/classic/entity/StreamEntity_Test.java | 207 --
.../classic/header/ContentType_Match_Test.java | 100 -
.../classic/header/ContentType_Other_Test.java | 40 -
.../http/classic/header/HeaderBeanMeta_Test.java | 105 -
.../http/classic/header/HeaderList_Test.java | 473 ---
.../http/classic/part/BasicPart_Coverage_Test.java | 219 --
.../http/classic/part/PartBeanMeta_Test.java | 115 -
.../juneau/http/classic/part/PartList_Test.java | 536 ----
.../http/classic/resource/BasicResource_Test.java | 293 --
.../classic/resource/ByteArrayResource_Test.java | 143 -
.../http/classic/resource/FileResource_Test.java | 185 --
.../http/classic/resource/ReaderResource_Test.java | 138 -
.../http/classic/resource/StreamResource_Test.java | 138 -
.../http/classic/resource/StringResource_Test.java | 146 -
.../classic/response/ClassicResponse_Test.java | 204 --
.../juneau/http/header/ContentType_Test.java | 168 --
.../apache/juneau/http/header/EntityTag_Test.java | 86 -
.../juneau/http/header/HttpHeaderList_Test.java | 252 --
.../juneau/http/header/HttpIntegerHeader_Test.java | 110 -
.../juneau/http/header/HttpLongHeader_Test.java | 110 -
.../juneau/http/header/NamedHeaders_Test.java | 308 --
.../http/header/PolymorphicHeaders_Test.java | 176 --
.../org/apache/juneau/http/header/Thrown_Test.java | 184 --
.../juneau/http/part/HttpBooleanPart_Test.java | 123 -
.../apache/juneau/http/part/HttpDatePart_Test.java | 122 -
.../juneau/http/part/HttpIntegerPart_Test.java | 104 -
.../apache/juneau/http/part/HttpLongPart_Test.java | 104 -
.../apache/juneau/http/part/HttpPartList_Test.java | 255 --
.../apache/juneau/http/part/HttpParts_Test.java | 91 -
.../apache/juneau/http/part/HttpUriPart_Test.java | 117 -
.../http/resource/HttpResourceBean_Test.java | 109 -
.../BasicHttpException_FluentSetters_Test.java | 85 -
.../BasicHttpResponse_FluentSetters_Test.java | 124 -
.../http/response/HttpStatusLineBean_Test.java | 84 -
.../juneau/http/response/NamedResponses_Test.java | 187 --
.../juneau/junit/bct/BasicBeanConverter_Test.java | 713 -----
.../juneau/junit/bct/BctAssertions_Test.java | 803 -----
.../apache/juneau/junit/bct/BctConfig_Test.java | 349 ---
.../bct/BctConfiguration_ValueAdoption_Test.java | 79 -
.../org/apache/juneau/junit/bct/BctUtils_Test.java | 125 -
.../juneau/junit/bct/BeanConverter_Test.java | 365 ---
.../apache/juneau/junit/bct/Listifier_Test.java | 340 ---
.../apache/juneau/junit/bct/Listifiers_Test.java | 424 ---
.../juneau/junit/bct/NestedTokenizer_Test.java | 496 ----
.../juneau/junit/bct/PropertyExtractor_Test.java | 443 ---
.../juneau/junit/bct/PropertyExtractors_Test.java | 506 ----
.../junit/bct/PropertyNotFoundException_Test.java | 120 -
.../apache/juneau/junit/bct/Stringifier_Test.java | 412 ---
.../apache/juneau/junit/bct/Stringifiers_Test.java | 584 ----
.../org/apache/juneau/junit/bct/Swapper_Test.java | 470 ---
.../org/apache/juneau/junit/bct/Swappers_Test.java | 234 --
.../JuneauBeanStoreExtension_ClassScope_Test.java | 253 --
.../JuneauBeanStoreExtension_OverlayMode_Test.java | 175 --
.../junit5/JuneauBeanStoreExtension_Test.java | 350 ---
.../apache/juneau/junit5/TestBeanStore_Test.java | 237 --
.../junit5/testsupport/StubExtensionContext.java | 197 --
.../junit5/testsupport/StubParameterContext.java | 81 -
.../juneau/markdown/MarkdownAiUseCase_Test.java | 168 --
.../juneau/markdown/MarkdownAnnotation_Test.java | 267 --
.../juneau/markdown/MarkdownDocParser_Test.java | 264 --
.../markdown/MarkdownDocSerializer_Test.java | 316 --
.../juneau/markdown/MarkdownEdgeCases_Test.java | 203 --
.../juneau/markdown/MarkdownMediaType_Test.java | 47 -
.../juneau/markdown/MarkdownSerializer_Test.java | 236 --
.../juneau/markdown/MarkdownWriter_Test.java | 130 -
.../org/apache/juneau/marshall/ClassMeta_Test.java | 314 --
.../MarshalledPropertyPostProcessor_Test.java | 512 ----
.../juneau/marshall/MarshallingContext_Test.java | 178 --
.../juneau/marshall/bson/BsonAnnotation_Test.java | 163 -
.../juneau/marshall/bson/BsonArrayDebug_Test.java | 57 -
.../marshall/bson/BsonCompatibility_Test.java | 123 -
.../juneau/marshall/bson/BsonEdgeCases_Test.java | 100 -
.../juneau/marshall/bson/BsonIntArray_Test.java | 101 -
.../juneau/marshall/bson/BsonMediaType_Test.java | 50 -
.../marshall/bson/BsonOutputStream_Test.java | 198 --
.../juneau/marshall/bson/BsonParser_Test.java | 77 -
.../juneau/marshall/bson/BsonRoundTrip_Test.java | 118 -
.../juneau/marshall/bson/BsonSerializer_Test.java | 113 -
.../juneau/marshall/bson/BsonTrimStrings_Test.java | 53 -
.../juneau/marshall/cbor/CborAnnotation_Test.java | 179 --
.../juneau/marshall/cbor/CborCompliance_Test.java | 103 -
.../juneau/marshall/cbor/CborEdgeCases_Test.java | 105 -
.../juneau/marshall/cbor/CborInputStream_Test.java | 130 -
.../juneau/marshall/cbor/CborMediaType_Test.java | 50 -
.../marshall/cbor/CborOutputStream_Test.java | 238 --
.../juneau/marshall/cbor/CborParser_Test.java | 165 --
.../juneau/marshall/cbor/CborRoundTrip_Test.java | 141 -
.../juneau/marshall/cbor/CborSerializer_Test.java | 287 --
.../juneau/marshall/csv/CsvAnnotation_Test.java | 183 --
.../apache/juneau/marshall/csv/CsvConfig_Test.java | 69 -
.../juneau/marshall/csv/CsvParserSession_Test.java | 451 ---
.../apache/juneau/marshall/csv/CsvParser_Test.java | 294 --
.../org/apache/juneau/marshall/csv/Csv_Test.java | 570 ----
.../marshall/hjson/HjsonAnnotation_Test.java | 137 -
.../juneau/marshall/hjson/HjsonEdgeCases_Test.java | 159 -
.../juneau/marshall/hjson/HjsonMediaType_Test.java | 58 -
.../juneau/marshall/hjson/HjsonParser_Test.java | 158 -
.../juneau/marshall/hjson/HjsonRoundTrip_Test.java | 169 --
.../marshall/hjson/HjsonSerializer_Test.java | 151 -
.../juneau/marshall/hjson/HjsonTokenizer_Test.java | 170 --
.../marshall/hocon/HoconAnnotation_Test.java | 137 -
.../juneau/marshall/hocon/HoconEdgeCases_Test.java | 118 -
.../juneau/marshall/hocon/HoconMediaType_Test.java | 58 -
.../juneau/marshall/hocon/HoconMerging_Test.java | 86 -
.../marshall/hocon/HoconParserSession_Test.java | 650 ----
.../juneau/marshall/hocon/HoconParser_Test.java | 325 --
.../juneau/marshall/hocon/HoconPath_Test.java | 80 -
.../juneau/marshall/hocon/HoconRoundTrip_Test.java | 193 --
.../marshall/hocon/HoconSerializer_Test.java | 250 --
.../marshall/hocon/HoconSubstitution_Test.java | 87 -
.../juneau/marshall/hocon/HoconTokenizer_Test.java | 934 ------
.../juneau/marshall/html/BasicHtml_Test.java | 3122 --------------------
.../juneau/marshall/html/CommonParser_Test.java | 152 -
.../apache/juneau/marshall/html/Common_Test.java | 350 ---
.../juneau/marshall/html/HtmlAnnotation_Test.java | 111 -
.../marshall/html/HtmlConfigAnnotation_Test.java | 121 -
.../html/HtmlDocConfigAnnotation_Test.java | 393 ---
.../html/HtmlDocSerializer_Builder_Test.java | 316 --
.../marshall/html/HtmlLinkAnnotation_Test.java | 93 -
.../marshall/html/HtmlSchemaSerializer_Test.java | 83 -
.../org/apache/juneau/marshall/html/Html_Test.java | 451 ---
.../marshall/html/SimpleHtmlWriter_Test.java | 262 --
.../HttpPartSchema_JakartaValidation_Test.java | 326 --
.../httppart/HttpPartSchema_Validation_Test.java | 1379 ---------
.../marshall/httppart/OpenApiPartParser_Test.java | 1065 -------
.../httppart/OpenApiPartSerializer_Test.java | 1028 -------
.../httppart/SchemaValidationException_Test.java | 78 -
.../marshall/httppart/UonPartParser_Test.java | 278 --
.../juneau/marshall/ini/IniAnnotation_Test.java | 237 --
.../apache/juneau/marshall/ini/IniParser_Test.java | 131 -
.../juneau/marshall/ini/IniRoundTrip_Test.java | 186 --
.../juneau/marshall/ini/IniSerializer_Test.java | 221 --
.../juneau/marshall/jcs/JcsCanonical_Test.java | 131 -
.../juneau/marshall/jcs/JcsEdgeCases_Test.java | 99 -
.../juneau/marshall/jcs/JcsNumbers_Test.java | 134 -
.../juneau/marshall/jcs/JcsSorting_Test.java | 117 -
.../juneau/marshall/jcs/JcsStrings_Test.java | 104 -
.../juneau/marshall/jena/RdfAnnotation_Test.java | 80 -
.../marshall/jena/RdfConfigAnnotation_Test.java | 341 ---
.../juneau/marshall/jena/RdfParser_Test.java | 457 ---
.../juneau/marshall/jena/RdfSerializer_Test.java | 615 ----
.../apache/juneau/marshall/jena/RdfUtils_Test.java | 223 --
.../juneau/marshall/json/CommonParser_Test.java | 159 -
.../apache/juneau/marshall/json/Common_Test.java | 305 --
.../juneau/marshall/json/JsonAnnotation_Test.java | 117 -
.../marshall/json/JsonConfigAnnotationTest.java | 108 -
.../marshall/json/JsonParserEdgeCases_Test.java | 476 ---
.../juneau/marshall/json/JsonParser_Test.java | 265 --
.../marshall/json/JsonSchemaSerializer_Test.java | 53 -
.../org/apache/juneau/marshall/json/Json_Test.java | 377 ---
.../juneau/marshall/json5/CommonParser_Test.java | 161 -
.../apache/juneau/marshall/json5/Common_Test.java | 305 --
.../juneau/marshall/jsonl/JsonlEdgeCases_Test.java | 125 -
.../juneau/marshall/jsonl/JsonlMediaType_Test.java | 70 -
.../juneau/marshall/jsonl/JsonlParser_Test.java | 130 -
.../juneau/marshall/jsonl/JsonlRoundTrip_Test.java | 158 -
.../apache/juneau/marshall/jsonl/Jsonl_Test.java | 168 --
.../jsonschema/ExternalDocsAnnotation_Test.java | 91 -
.../marshall/jsonschema/ItemsAnnotation_Test.java | 221 --
.../jsonschema/JsonSchemaConfigAnnotationTest.java | 120 -
.../jsonschema/JsonSchemaGeneratorTest.java | 1571 ----------
.../marshall/jsonschema/SchemaAnnotation_Test.java | 655 ----
.../jsonschema/SchemaApplyAnnotation_Test.java | 132 -
.../marshall/jsonschema/SchemaUtils_Test.java | 127 -
.../jsonschema/SubItemsAnnotation_Test.java | 316 --
.../marshall/msgpack/MsgPackAnnotation_Test.java | 183 --
.../msgpack/MsgPackConfigAnnotationTest.java | 100 -
.../marshall/msgpack/MsgPackMediaType_Test.java | 90 -
.../marshall/msgpack/MsgPackParser_Test.java | 127 -
.../marshall/msgpack/MsgPackSerializerTest.java | 224 --
.../marshall/oapi/OpenApiAnnotation_Test.java | 151 -
.../oapi/OpenApiConfigAnnotation_Test.java | 69 -
.../apache/juneau/marshall/oapi/OpenApi_Test.java | 869 ------
.../objecttools/ObjectIntrospector_Test.java | 57 -
.../marshall/objecttools/ObjectMerger_Test.java | 82 -
.../marshall/objecttools/ObjectPaginator_Test.java | 103 -
.../marshall/objecttools/ObjectRest_Test.java | 1217 --------
.../marshall/objecttools/ObjectSorter_Test.java | 246 --
.../marshall/objecttools/ObjectViewer_Test.java | 315 --
.../marshall/parquet/ParquetAnnotation_Test.java | 177 --
.../marshall/parquet/ParquetLogicalType_Test.java | 143 -
.../marshall/parquet/ParquetParser_Test.java | 85 -
.../marshall/parquet/ParquetRoundTrip_Test.java | 281 --
.../marshall/parquet/ParquetSerializer_Test.java | 115 -
.../parser/ParserConfigAnnotationTest.java | 154 -
.../juneau/marshall/parser/ParserSession_Test.java | 975 ------
.../parser/ParserSet_OverridingBeanStore_Test.java | 72 -
.../juneau/marshall/parser/ParserSet_Test.java | 238 --
.../plaintext/PlainTextAnnotation_Test.java | 151 -
.../plaintext/PlainTextConfigAnnotation_Test.java | 69 -
.../marshall/proto/ProtoAnnotation_Test.java | 206 --
.../juneau/marshall/proto/ProtoEdgeCases_Test.java | 132 -
.../juneau/marshall/proto/ProtoMediaType_Test.java | 52 -
.../juneau/marshall/proto/ProtoParser_Test.java | 190 --
.../marshall/proto/ProtoSerializer_Test.java | 256 --
.../juneau/marshall/proto/ProtoTokenizer_Test.java | 613 ----
.../ReaderObject_ComboSerializeTest.java | 328 --
.../serializer/SerializerSession_Test.java | 1245 --------
.../SerializerSet_OverridingBeanStore_Test.java | 74 -
.../marshall/serializer/SerializerSet_Test.java | 335 ---
.../apache/juneau/marshall/serializer/TestURI.java | 94 -
.../juneau/marshall/serializer/TestURIc.java | 94 -
.../marshall/serializer/UriResolution_Test.java | 759 -----
.../serializer/WriterFluentSetters_Test.java | 148 -
.../marshall/soap/SoapXmlAnnotation_Test.java | 151 -
.../marshall/soap/SoapXmlConfigAnnotationTest.java | 85 -
.../juneau/marshall/toml/TomlSerializer_Test.java | 68 -
.../juneau/marshall/toml/TomlTokenizer_Test.java | 916 ------
.../juneau/marshall/toml/TomlWriter_Test.java | 613 ----
.../org/apache/juneau/marshall/toml/Toml_Test.java | 635 ----
.../marshall/transform/AutoListSwapTest.java | 431 ---
.../juneau/marshall/transform/AutoMapSwapTest.java | 426 ---
.../marshall/transform/AutoNumberSwapTest.java | 821 -----
.../marshall/transform/AutoObjectSwapTest.java | 412 ---
.../BeanDictionary_ComboRoundTripTest.java | 652 ----
.../juneau/marshall/transforms/BeanMap_Test.java | 99 -
.../marshall/transforms/BigNumberFormat_Test.java | 218 --
.../marshall/transforms/BinaryFormat_Test.java | 163 -
.../marshall/transforms/BooleanFormat_Test.java | 130 -
.../transforms/Builder_ComboRoundTripTest.java | 379 ---
.../BuiltInDateTimeSerialization_Test.java | 331 ---
.../ByteArrayBase64Swap_ComboRoundTripTest.java | 389 ---
.../marshall/transforms/CalendarFormat_Test.java | 135 -
.../ClassFormatSwap_SessionClassLoader_Test.java | 174 --
.../marshall/transforms/ClassFormat_Test.java | 273 --
.../marshall/transforms/CurrencyFormat_Test.java | 205 --
.../marshall/transforms/DateFormat_Test.java | 108 -
.../marshall/transforms/DefaultSwaps_Test.java | 732 -----
.../transforms/DurationAndPeriodFormat_Test.java | 115 -
.../transforms/DurationFormatPlacement_Test.java | 80 -
.../marshall/transforms/EnumFormat_Test.java | 181 --
.../marshall/transforms/FloatFormat_Test.java | 220 --
.../InputStreamBase64_OneWayStringSwapTest.java | 51 -
.../marshall/transforms/LocaleFormat_Test.java | 61 -
.../marshall/transforms/MarshalledFilter_Test.java | 181 --
.../juneau/marshall/transforms/ObjectSwapTest.java | 99 -
.../transforms/OneWayStringSwapTest_Base.java | 33 -
.../transforms/OneWayStringSwap_Tester.java | 109 -
.../marshall/transforms/ReaderFilter_Test.java | 101 -
.../ReaderObjectSwap_ComboSerializeTest.java | 427 ---
.../marshall/transforms/ReaderSwap_Test.java | 51 -
.../transforms/RoundTripObjectSwapTest_Base.java | 39 -
.../transforms/RoundTripObjectSwap_Tester.java | 124 -
.../transforms/StackTraceElementSwap_Test.java | 60 -
.../transforms/StreamableSerializationTest.java | 242 --
.../marshall/transforms/StringSwapTest_Base.java | 39 -
.../marshall/transforms/StringSwap_Tester.java | 128 -
.../SwapsAnnotation_ComboSerializeTest.java | 784 -----
.../marshall/transforms/TemporalFormat_Test.java | 242 --
.../marshall/transforms/TimeZoneFormat_Test.java | 70 -
.../TopLevelDefaultSwapsRoundTrip_Test.java | 99 -
.../marshall/transforms/UuidFormat_Test.java | 136 -
.../juneau/marshall/uon/CommonParser_UonTest.java | 159 -
.../apache/juneau/marshall/uon/Common_UonTest.java | 228 --
.../juneau/marshall/uon/UonAnnotation_Test.java | 180 --
.../marshall/uon/UonConfigAnnotationTest.java | 116 -
.../juneau/marshall/uon/UonParserReader_Test.java | 221 --
.../apache/juneau/marshall/uon/UonParser_Test.java | 535 ----
.../juneau/marshall/uon/UonSerializer_Test.java | 361 ---
.../urlencoding/CommonParser_UrlEncodingTest.java | 164 -
.../urlencoding/Common_UrlEncodingTest.java | 212 --
.../apache/juneau/marshall/urlencoding/DTOs.java | 143 -
.../apache/juneau/marshall/urlencoding/DTOs2.java | 147 -
.../urlencoding/UrlEncodingAnnotation_Test.java | 117 -
.../UrlEncodingConfigAnnotationTest.java | 103 -
.../urlencoding/UrlEncodingParser_Test.java | 734 -----
.../urlencoding/UrlEncodingSerializer_Test.java | 582 ----
.../apache/juneau/marshall/xml/BasicXml_Test.java | 1778 -----------
.../juneau/marshall/xml/CommonParser_Test.java | 158 -
.../apache/juneau/marshall/xml/CommonXml_Test.java | 83 -
.../apache/juneau/marshall/xml/Common_Test.java | 248 --
.../juneau/marshall/xml/InvalidXmlBeans_Test.java | 235 --
.../juneau/marshall/xml/XmlAnnotation_Test.java | 101 -
.../juneau/marshall/xml/XmlCollapsed_Test.java | 389 ---
.../marshall/xml/XmlConfigAnnotationTest.java | 180 --
.../juneau/marshall/xml/XmlContent_Test.java | 249 --
.../marshall/xml/XmlIgnoreComments_Test.java | 1237 --------
.../juneau/marshall/xml/XmlParserSession_Test.java | 510 ----
.../apache/juneau/marshall/xml/XmlParser_Test.java | 92 -
.../apache/juneau/marshall/xml/XmlUtils_Test.java | 442 ---
.../org/apache/juneau/marshall/xml/Xml_Test.java | 986 -------
.../org/apache/juneau/marshall/xml/xml1a/T1.java | 41 -
.../org/apache/juneau/marshall/xml/xml1a/T2.java | 41 -
.../org/apache/juneau/marshall/xml/xml1b/T3.java | 40 -
.../org/apache/juneau/marshall/xml/xml1b/T4.java | 40 -
.../org/apache/juneau/marshall/xml/xml1b/T5.java | 41 -
.../org/apache/juneau/marshall/xml/xml1b/T6.java | 41 -
.../org/apache/juneau/marshall/xml/xml1b/T7.java | 41 -
.../juneau/marshall/xml/xml1b/package-info.java | 23 -
.../org/apache/juneau/marshall/xml/xml1c/T8.java | 36 -
.../org/apache/juneau/marshall/xml/xml1c/T9.java | 26 -
.../juneau/marshall/xml/xml1c/package-info.java | 32 -
.../juneau/marshall/yaml/YamlMarshaller_Test.java | 75 -
.../juneau/marshall/yaml/YamlParser_Test.java | 138 -
.../org/apache/juneau/marshaller/Bson_Test.java | 90 -
.../org/apache/juneau/marshaller/Cbor_Test.java | 85 -
.../org/apache/juneau/marshaller/Csv_Test.java | 82 -
.../org/apache/juneau/marshaller/Hjson_Test.java | 72 -
.../org/apache/juneau/marshaller/Hocon_Test.java | 72 -
.../org/apache/juneau/marshaller/Html_Test.java | 68 -
.../org/apache/juneau/marshaller/Ini_Test.java | 70 -
.../org/apache/juneau/marshaller/Jcs_Test.java | 56 -
.../org/apache/juneau/marshaller/Json5_Test.java | 67 -
.../org/apache/juneau/marshaller/Json_Test.java | 68 -
.../org/apache/juneau/marshaller/Jsonl_Test.java | 98 -
.../apache/juneau/marshaller/Markdown_Test.java | 67 -
.../apache/juneau/marshaller/Marshall_Test.java | 32 -
.../org/apache/juneau/marshaller/MsgPack_Test.java | 68 -
.../org/apache/juneau/marshaller/OpenApi_Test.java | 68 -
.../org/apache/juneau/marshaller/Parquet_Test.java | 98 -
.../apache/juneau/marshaller/PlainText_Test.java | 68 -
.../org/apache/juneau/marshaller/Proto_Test.java | 126 -
.../org/apache/juneau/marshaller/Uon_Test.java | 68 -
.../apache/juneau/marshaller/UrlEncoding_Test.java | 68 -
.../org/apache/juneau/marshaller/Xml_Test.java | 67 -
.../BasicMicroserviceListener_Test.java | 51 -
.../apache/juneau/microservice/LogConfig_Test.java | 115 -
.../microservice/Microservice_Builder_Test.java | 180 --
.../microservice/Microservice_Inject_Test.java | 236 --
.../microservice/Microservice_Lifecycle_Test.java | 491 ---
.../Microservice_Listener_Fanout_Test.java | 142 -
.../Microservice_OverridingBeanStore_Test.java | 110 -
.../Microservice_PushPopOverlay_Test.java | 104 -
.../microservice/Microservice_Runtime_Test.java | 506 ----
.../Microservice_ValueAdoption_Test.java | 62 -
.../microservice/console/ConfigCommand_Test.java | 161 -
.../microservice/console/ConsoleCommand_Test.java | 166 --
.../microservice/console/HelpCommand_Test.java | 177 --
.../jetty/JettyConfiguration_Test.java | 257 --
.../microservice/jetty/JettyLogger_Test.java | 550 ----
.../RestPathsRuntimeOverride_JettyMount_Test.java | 223 --
.../juneau/microservice/jetty/Rest_Paths_Test.java | 116 -
.../resources/DirectoryResource_Action_Test.java | 91 -
.../resources/DirectoryResource_Coverage_Test.java | 267 --
.../DirectoryResource_PathTraversal_Test.java | 277 --
.../resources/LogEntryFormatter_Test.java | 197 --
.../microservice/resources/LogParser_Test.java | 410 ---
.../resources/LogsResource_Action_Test.java | 115 -
.../resources/LogsResource_Coverage_Test.java | 302 --
.../resources/LogsResource_PathTraversal_Test.java | 254 --
.../resources/MicroserviceResources_Test.java | 234 --
.../RestPathsRuntimeOverride_TomcatMount_Test.java | 202 --
.../tomcat/TomcatConfiguration_Test.java | 216 --
.../microservice/tomcat/TomcatLogger_Test.java | 138 -
.../microservice/tomcat/Tomcat_Paths_Test.java | 104 -
.../juneau/rest/mock/MockHttpSession_Test.java | 123 -
.../juneau/rest/mock/MockRestClient_Test.java | 306 --
.../mock/MockRestClient_TestOverride_Test.java | 190 --
.../juneau/rest/mock/MockServletRequest_Test.java | 370 ---
.../apache/juneau/rest/mock/PathResolverTest.java | 364 ---
.../mock/classic/MockRestClient_Coverage_Test.java | 235 --
.../mock/classic/MockRestClient_PathVars_Test.java | 44 -
.../rest/mock/classic/MockRestRequest_Test.java | 226 --
.../apache/juneau/rest/mock2/MockLogger_Test.java | 138 -
.../mock2/MockServletRequest_Coverage_Test.java | 511 ----
.../juneau/rest/mock2/MockServletRequest_Test.java | 101 -
.../mock2/MockServletResponse_Coverage_Test.java | 180 --
.../pojos/PrimitiveAtomicObjectsBean.java | 82 -
.../testutils/pojos/PrimitiveObjectsBean.java | 186 --
.../apache/juneau/testutils/pojos/TestEnum.java | 21 -
.../juneau/testutils/pojos/TestEnumToString.java | 42 -
.../juneau/utest/utils/CapturingPrintStream.java | 34 -
.../org/apache/juneau/utest/utils/Constants.java | 24 -
.../juneau/utest/utils/FakeTimeProvider.java | 46 -
.../apache/juneau/utest/utils/MutableSupplier.java | 40 -
juneau-utest/test-run-history.tsv | 1 +
perf-baseline.txt | 62 +
scripts/__pycache__/coverage.cpython-314.pyc | Bin 13487 -> 0 bytes
scripts/check-container-tags.py | 25 +-
scripts/ci-perf-guard.py | 181 +-
scripts/microbench.py | 2 +-
scripts/test.py | 314 +-
1135 files changed, 522 insertions(+), 232177 deletions(-)
diff --git a/juneau-bean/juneau-bean-atom/pom.xml b/juneau-bean/juneau-bean-atom/pom.xml
index d05b9d96af..f764cfa67b 100644
--- a/juneau-bean/juneau-bean-atom/pom.xml
+++ b/juneau-bean/juneau-bean-atom/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-atom/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-atom/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-atom/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-common/pom.xml b/juneau-bean/juneau-bean-common/pom.xml
index 8c576ca625..6de1e2f273 100644
--- a/juneau-bean/juneau-bean-common/pom.xml
+++ b/juneau-bean/juneau-bean-common/pom.xml
@@ -64,6 +64,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-common/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-common/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-common/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-hal/pom.xml b/juneau-bean/juneau-bean-hal/pom.xml
index e0c38f1433..7984671f31 100644
--- a/juneau-bean/juneau-bean-hal/pom.xml
+++ b/juneau-bean/juneau-bean-hal/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-hal/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-hal/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-hal/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-html5/pom.xml b/juneau-bean/juneau-bean-html5/pom.xml
index 1c77f62125..599027b99b 100644
--- a/juneau-bean/juneau-bean-html5/pom.xml
+++ b/juneau-bean/juneau-bean-html5/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-html5/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-html5/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-html5/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-jsonapi/pom.xml b/juneau-bean/juneau-bean-jsonapi/pom.xml
index 3d9c0331bf..6ebe802fbf 100644
--- a/juneau-bean/juneau-bean-jsonapi/pom.xml
+++ b/juneau-bean/juneau-bean-jsonapi/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-jsonapi/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-jsonapi/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-jsonapi/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-jsonpatch/pom.xml b/juneau-bean/juneau-bean-jsonpatch/pom.xml
index ca595fd1c7..8ed665f80a 100644
--- a/juneau-bean/juneau-bean-jsonpatch/pom.xml
+++ b/juneau-bean/juneau-bean-jsonpatch/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-jsonpatch/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-jsonpatch/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-jsonpatch/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-jsonschema/pom.xml b/juneau-bean/juneau-bean-jsonschema/pom.xml
index 380068b19a..490b6bc175 100644
--- a/juneau-bean/juneau-bean-jsonschema/pom.xml
+++ b/juneau-bean/juneau-bean-jsonschema/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-jsonschema/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-jsonschema/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-jsonschema/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-mcp/pom.xml b/juneau-bean/juneau-bean-mcp/pom.xml
index fdf168334e..36bc51dd88 100644
--- a/juneau-bean/juneau-bean-mcp/pom.xml
+++ b/juneau-bean/juneau-bean-mcp/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-mcp/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-mcp/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-mcp/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-openapi-v3/pom.xml b/juneau-bean/juneau-bean-openapi-v3/pom.xml
index ee0530b4ad..c3745fd8d7 100644
--- a/juneau-bean/juneau-bean-openapi-v3/pom.xml
+++ b/juneau-bean/juneau-bean-openapi-v3/pom.xml
@@ -63,6 +63,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-openapi-v3/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-openapi-v3/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-openapi-v3/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-rfc7807/pom.xml b/juneau-bean/juneau-bean-rfc7807/pom.xml
index a493624d09..9dce9f8da2 100644
--- a/juneau-bean/juneau-bean-rfc7807/pom.xml
+++ b/juneau-bean/juneau-bean-rfc7807/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-rfc7807/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-rfc7807/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-rfc7807/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-bean/juneau-bean-swagger-v2/pom.xml b/juneau-bean/juneau-bean-swagger-v2/pom.xml
index 0e24b551df..11fdacc93e 100644
--- a/juneau-bean/juneau-bean-swagger-v2/pom.xml
+++ b/juneau-bean/juneau-bean-swagger-v2/pom.xml
@@ -63,6 +63,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-bean/juneau-bean-swagger-v2/src/test/java/org/apache/juneau/TestBase.java b/juneau-bean/juneau-bean-swagger-v2/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-bean/juneau-bean-swagger-v2/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-core/juneau-assertions/pom.xml b/juneau-core/juneau-assertions/pom.xml
index 18df569f10..d713227491 100644
--- a/juneau-core/juneau-assertions/pom.xml
+++ b/juneau-core/juneau-assertions/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/TestBase.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java
deleted file mode 100755
index ef43049607..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-
-import java.util.*;
-import java.util.concurrent.atomic.*;
-
-/**
- * Test bean fields of type AtomicInteger and AtomicLong.
- * Note that Jena parsers cannot handle these types, so we only test non-Jena parsers.
- */
-@SuppressWarnings({})
-public class PrimitiveAtomicObjectsBean {
-
- // primitive objects
- public AtomicInteger poAtomicInteger;
- public AtomicLong poAtomicLong;
-
- // uninitialized primitive objects
- public AtomicInteger pouAtomicInteger;
- public AtomicLong pouAtomicLong;
-
- // primitive object arrays
- public AtomicInteger[][] poaAtomicInteger;
- public AtomicLong[][] poaAtomicLong;
-
- // primitive object arrays
- public AtomicInteger[][] poauAtomicInteger;
- public AtomicLong[][] poauAtomicLong;
-
- // Anonymous list of primitives (types not erased on objects
- public List<AtomicInteger[]> poalAtomicInteger;
- public List<AtomicLong[]> poalAtomicLong;
-
- // Regular list of primitives (types erased on objects)
- public List<AtomicInteger[]> polAtomicInteger;
- public List<AtomicLong[]> polAtomicLong;
-
- private PrimitiveAtomicObjectsBean init() {
- // primitive objects
- poAtomicInteger = new AtomicInteger(1);
- poAtomicLong = new AtomicLong(2);
-
- // primitive object arrays
- poaAtomicInteger = a(a(new AtomicInteger(1)),a(new AtomicInteger(2)),null);
- poaAtomicLong = a(a(new AtomicLong(1)),a(new AtomicLong(2)),null);
-
- // Anonymous list of primitives
- poalAtomicInteger = l(a(new AtomicInteger(1)),null);
- poalAtomicLong = l(a(new AtomicLong(1)),null);
-
- // Regular list of primitives
- polAtomicInteger = list();
- polAtomicInteger.add(a(new AtomicInteger(1)));
- polAtomicInteger.add(null);
- polAtomicLong = list();
- polAtomicLong.add(a(new AtomicLong(1)));
- polAtomicLong.add(null);
-
- return this;
- }
-
- public static PrimitiveAtomicObjectsBean get() {
- return new PrimitiveAtomicObjectsBean().init();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java
deleted file mode 100755
index d3f6a1cf6b..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-
-import java.math.*;
-import java.util.*;
-
-@SuppressWarnings({})
-public class PrimitiveObjectsBean {
-
- // primitive objects
- public Boolean poBoolean;
- public Byte poByte;
- public Character poChar;
- public Short poShort;
- public Integer poInt;
- public Long poLong;
- public Float poFloat;
- public Double poDouble;
- public Number poNumber;
- public BigInteger poBigInteger;
- public BigDecimal poBigDecimal;
-
- // uninitialized primitive objects
- public Boolean pouBoolean;
- public Byte pouByte;
- public Character pouChar;
- public Short pouShort;
- public Integer pouInt;
- public Long pouLong;
- public Float pouFloat;
- public Double pouDouble;
- public Number pouNumber;
- public BigInteger pouBigInteger;
- public BigDecimal pouBigDecimal;
-
- // primitive object arrays
- public Boolean[][] poaBoolean;
- public Byte[][] poaByte;
- public Character[][] poaChar;
- public Short[][] poaShort;
- public Integer[][] poaInt;
- public Long[][] poaLong;
- public Float[][] poaFloat;
- public Double[][] poaDouble;
- public Number[][] poaNumber;
- public BigInteger[][] poaBigInteger;
- public BigDecimal[][] poaBigDecimal;
-
- // primitive object arrays
- public Boolean[][] poauBoolean;
- public Byte[][] poauByte;
- public Character[][] poauChar;
- public Short[][] poauShort;
- public Integer[][] poauInt;
- public Long[][] poauLong;
- public Float[][] poauFloat;
- public Double[][] poauDouble;
- public Number[][] poauNumber;
- public BigInteger[][] poauBigInteger;
- public BigDecimal[][] poauBigDecimal;
-
- // Anonymous list of primitives (types not erased on objects
- public List<Boolean[]> poalBoolean;
- public List<Byte[]> poalByte;
- public List<Character[]> poalChar;
- public List<Short[]> poalShort;
- public List<Integer[]> poalInt;
- public List<Long[]> poalLong;
- public List<Float[]> poalFloat;
- public List<Double[]> poalDouble;
- public List<Number[]> poalNumber;
- public List<BigInteger[]> poalBigInteger;
- public List<BigDecimal[]> poalBigDecimal;
-
- // Regular list of primitives (types erased on objects)
- public List<Boolean[]> polBoolean;
- public List<Byte[]> polByte;
- public List<Character[]> polChar;
- public List<Short[]> polShort;
- public List<Integer[]> polInt;
- public List<Long[]> polLong;
- public List<Float[]> polFloat;
- public List<Double[]> polDouble;
- public List<Number[]> polNumber;
- public List<BigInteger[]> polBigInteger;
- public List<BigDecimal[]> polBigDecimal;
-
- private PrimitiveObjectsBean init() {
- // primitive objects
- poBoolean = true;
- poByte = 1;
- poChar = 'a';
- poShort = 2;
- poInt = 3;
- poLong = 4L;
- poFloat = 5f;
- poDouble = 6d;
- poNumber = 7;
- poBigInteger = BigInteger.valueOf(8L);
- poBigDecimal = new BigDecimal("9");
-
- // primitive object arrays
- poaBoolean = a(a(true),a(false),null);
- poaByte = a(a((byte)1),a((byte)2),null);
- poaChar = a(a('a'),a('b'),null);
- poaShort = a(a((short)1),a((short)2),null);
- poaInt = a(a(1),a(2),null);
- poaLong = a(a(1L),a(2L),null);
- poaFloat = a(a(1f),a(2f),null);
- poaDouble = a(a(1d),a(2d),null);
- poaNumber = a(a((Number)1),a((Number)2),null);
- poaBigInteger = a(a(BigInteger.valueOf(1L)),a(BigInteger.valueOf(2L)), null);
- poaBigDecimal = a(a(new BigDecimal("1")),a(new BigDecimal("2")), null);
-
- // Anonymous list of primitives
- poalBoolean = l(a(Boolean.TRUE),null);
- poalByte = l(a((byte)1),null);
- poalChar = l(a('a'),null);
- poalShort = l(a((short)1),null);
- poalInt = l(a(1),null);
- poalLong = l(a(1L),null);
- poalFloat = l(a(1f),null);
- poalDouble = l(a(1d),null);
- poalNumber = l(a(1),null);
- poalBigInteger = l(a(BigInteger.valueOf(1L)),null);
- poalBigDecimal = l(a(new BigDecimal("1")),null);
-
- // Regular list of primitives
- polBoolean = list();
- polBoolean.add(a(Boolean.TRUE));
- polBoolean.add(null);
- polByte = list();
- polByte.add(a((byte)1));
- polByte.add(null);
- polChar = list();
- polChar.add(a('a'));
- polChar.add(null);
- polShort = list();
- polShort.add(a((short)1));
- polShort.add(null);
- polInt = list();
- polInt.add(a(1));
- polInt.add(null);
- polLong = list();
- polLong.add(a(1L));
- polLong.add(null);
- polFloat = list();
- polFloat.add(a(1f));
- polFloat.add(null);
- polDouble = list();
- polDouble.add(a(1d));
- polDouble.add(null);
- polNumber = list();
- polNumber.add(a((Number)1));
- polNumber.add(null);
- polBigInteger = list();
- polBigInteger.add(a(BigInteger.valueOf(1L)));
- polBigInteger.add(null);
- polBigDecimal = list();
- polBigDecimal.add(a(new BigDecimal("1")));
- polBigDecimal.add(null);
-
- return this;
- }
-
- public static PrimitiveObjectsBean get() {
- return new PrimitiveObjectsBean().init();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java
deleted file mode 100644
index ef08e967b4..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-public enum TestEnum {
- ONE,TWO,THREE
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java
deleted file mode 100644
index f031afebc5..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.Utils.*;
-
-public enum TestEnumToString {
-
- ONE("one"), TWO("two"), THREE("three");
-
- private String val;
-
- TestEnumToString(String val) {
- this.val = val;
- }
-
- public static TestEnumToString fromString(String val) {
- for (var e : values())
- if (eq(e.val, val))
- return e;
- return null;
- }
-
- @Override
- public String toString() {
- return val;
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java
deleted file mode 100644
index bf13fe1caf..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.io.*;
-
-/**
- * Convenience class for capturing contents sent to a {@link PrintStream}
- */
-public class CapturingPrintStream extends PrintStream {
-
- public CapturingPrintStream() {
- super(new ByteArrayOutputStream(), true);
- }
-
- @Override
- public String toString() {
- return out.toString();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/Constants.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/Constants.java
deleted file mode 100644
index 9440017044..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/Constants.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-public class Constants {
-
- private Constants() {}
-
- public static final String SWAP = "swap-~!@#$%^&*()_+`-={}[]|:;\"<,>.?/";
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java
deleted file mode 100644
index 179bf6485e..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.time.*;
-
-import org.apache.juneau.commons.time.*;
-
-/**
- * A fake time provider for testing that always returns UTC timezone and a fixed time.
- */
-public class FakeTimeProvider extends TimeProvider {
-
- private static final ZoneId UTC = ZoneId.of("UTC");
- private static final ZonedDateTime FIXED_TIME = ZonedDateTime.of(2000, 1, 1, 12, 0, 0, 0, UTC);
-
- @Override
- public ZoneId getSystemDefaultZoneId() {
- return UTC;
- }
-
- @Override
- public ZonedDateTime now() {
- return FIXED_TIME;
- }
-
- @Override
- public ZonedDateTime now(ZoneId zoneId) {
- return FIXED_TIME.withZoneSameInstant(zoneId);
- }
-}
-
diff --git a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java b/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java
deleted file mode 100644
index a862353fd4..0000000000
--- a/juneau-core/juneau-assertions/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.util.function.*;
-
-/**
- * A simple supplier of objects.
- */
-public class MutableSupplier<T> implements Supplier<T> {
- public T value;
-
- public static <T> MutableSupplier<T> of(T value) {
- return new MutableSupplier<T>().set(value);
- }
-
- public MutableSupplier<T> set(T value) {
- this.value = value;
- return this;
- }
-
- @Override
- public T get() {
- return value;
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-bct/pom.xml b/juneau-core/juneau-bct/pom.xml
index d666c76606..acf0fb0f4d 100644
--- a/juneau-core/juneau-bct/pom.xml
+++ b/juneau-core/juneau-bct/pom.xml
@@ -51,6 +51,12 @@
<artifactId>opentest4j</artifactId>
<version>1.3.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-core/juneau-bct/src/test/java/org/apache/juneau/TestBase.java b/juneau-core/juneau-bct/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-core/juneau-bct/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-core/juneau-config/pom.xml b/juneau-core/juneau-config/pom.xml
index 5c7173419e..130adfa2c2 100644
--- a/juneau-core/juneau-config/pom.xml
+++ b/juneau-core/juneau-config/pom.xml
@@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/TestBase.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java
deleted file mode 100755
index ef43049607..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-
-import java.util.*;
-import java.util.concurrent.atomic.*;
-
-/**
- * Test bean fields of type AtomicInteger and AtomicLong.
- * Note that Jena parsers cannot handle these types, so we only test non-Jena parsers.
- */
-@SuppressWarnings({})
-public class PrimitiveAtomicObjectsBean {
-
- // primitive objects
- public AtomicInteger poAtomicInteger;
- public AtomicLong poAtomicLong;
-
- // uninitialized primitive objects
- public AtomicInteger pouAtomicInteger;
- public AtomicLong pouAtomicLong;
-
- // primitive object arrays
- public AtomicInteger[][] poaAtomicInteger;
- public AtomicLong[][] poaAtomicLong;
-
- // primitive object arrays
- public AtomicInteger[][] poauAtomicInteger;
- public AtomicLong[][] poauAtomicLong;
-
- // Anonymous list of primitives (types not erased on objects
- public List<AtomicInteger[]> poalAtomicInteger;
- public List<AtomicLong[]> poalAtomicLong;
-
- // Regular list of primitives (types erased on objects)
- public List<AtomicInteger[]> polAtomicInteger;
- public List<AtomicLong[]> polAtomicLong;
-
- private PrimitiveAtomicObjectsBean init() {
- // primitive objects
- poAtomicInteger = new AtomicInteger(1);
- poAtomicLong = new AtomicLong(2);
-
- // primitive object arrays
- poaAtomicInteger = a(a(new AtomicInteger(1)),a(new AtomicInteger(2)),null);
- poaAtomicLong = a(a(new AtomicLong(1)),a(new AtomicLong(2)),null);
-
- // Anonymous list of primitives
- poalAtomicInteger = l(a(new AtomicInteger(1)),null);
- poalAtomicLong = l(a(new AtomicLong(1)),null);
-
- // Regular list of primitives
- polAtomicInteger = list();
- polAtomicInteger.add(a(new AtomicInteger(1)));
- polAtomicInteger.add(null);
- polAtomicLong = list();
- polAtomicLong.add(a(new AtomicLong(1)));
- polAtomicLong.add(null);
-
- return this;
- }
-
- public static PrimitiveAtomicObjectsBean get() {
- return new PrimitiveAtomicObjectsBean().init();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java
deleted file mode 100755
index d3f6a1cf6b..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-
-import java.math.*;
-import java.util.*;
-
-@SuppressWarnings({})
-public class PrimitiveObjectsBean {
-
- // primitive objects
- public Boolean poBoolean;
- public Byte poByte;
- public Character poChar;
- public Short poShort;
- public Integer poInt;
- public Long poLong;
- public Float poFloat;
- public Double poDouble;
- public Number poNumber;
- public BigInteger poBigInteger;
- public BigDecimal poBigDecimal;
-
- // uninitialized primitive objects
- public Boolean pouBoolean;
- public Byte pouByte;
- public Character pouChar;
- public Short pouShort;
- public Integer pouInt;
- public Long pouLong;
- public Float pouFloat;
- public Double pouDouble;
- public Number pouNumber;
- public BigInteger pouBigInteger;
- public BigDecimal pouBigDecimal;
-
- // primitive object arrays
- public Boolean[][] poaBoolean;
- public Byte[][] poaByte;
- public Character[][] poaChar;
- public Short[][] poaShort;
- public Integer[][] poaInt;
- public Long[][] poaLong;
- public Float[][] poaFloat;
- public Double[][] poaDouble;
- public Number[][] poaNumber;
- public BigInteger[][] poaBigInteger;
- public BigDecimal[][] poaBigDecimal;
-
- // primitive object arrays
- public Boolean[][] poauBoolean;
- public Byte[][] poauByte;
- public Character[][] poauChar;
- public Short[][] poauShort;
- public Integer[][] poauInt;
- public Long[][] poauLong;
- public Float[][] poauFloat;
- public Double[][] poauDouble;
- public Number[][] poauNumber;
- public BigInteger[][] poauBigInteger;
- public BigDecimal[][] poauBigDecimal;
-
- // Anonymous list of primitives (types not erased on objects
- public List<Boolean[]> poalBoolean;
- public List<Byte[]> poalByte;
- public List<Character[]> poalChar;
- public List<Short[]> poalShort;
- public List<Integer[]> poalInt;
- public List<Long[]> poalLong;
- public List<Float[]> poalFloat;
- public List<Double[]> poalDouble;
- public List<Number[]> poalNumber;
- public List<BigInteger[]> poalBigInteger;
- public List<BigDecimal[]> poalBigDecimal;
-
- // Regular list of primitives (types erased on objects)
- public List<Boolean[]> polBoolean;
- public List<Byte[]> polByte;
- public List<Character[]> polChar;
- public List<Short[]> polShort;
- public List<Integer[]> polInt;
- public List<Long[]> polLong;
- public List<Float[]> polFloat;
- public List<Double[]> polDouble;
- public List<Number[]> polNumber;
- public List<BigInteger[]> polBigInteger;
- public List<BigDecimal[]> polBigDecimal;
-
- private PrimitiveObjectsBean init() {
- // primitive objects
- poBoolean = true;
- poByte = 1;
- poChar = 'a';
- poShort = 2;
- poInt = 3;
- poLong = 4L;
- poFloat = 5f;
- poDouble = 6d;
- poNumber = 7;
- poBigInteger = BigInteger.valueOf(8L);
- poBigDecimal = new BigDecimal("9");
-
- // primitive object arrays
- poaBoolean = a(a(true),a(false),null);
- poaByte = a(a((byte)1),a((byte)2),null);
- poaChar = a(a('a'),a('b'),null);
- poaShort = a(a((short)1),a((short)2),null);
- poaInt = a(a(1),a(2),null);
- poaLong = a(a(1L),a(2L),null);
- poaFloat = a(a(1f),a(2f),null);
- poaDouble = a(a(1d),a(2d),null);
- poaNumber = a(a((Number)1),a((Number)2),null);
- poaBigInteger = a(a(BigInteger.valueOf(1L)),a(BigInteger.valueOf(2L)), null);
- poaBigDecimal = a(a(new BigDecimal("1")),a(new BigDecimal("2")), null);
-
- // Anonymous list of primitives
- poalBoolean = l(a(Boolean.TRUE),null);
- poalByte = l(a((byte)1),null);
- poalChar = l(a('a'),null);
- poalShort = l(a((short)1),null);
- poalInt = l(a(1),null);
- poalLong = l(a(1L),null);
- poalFloat = l(a(1f),null);
- poalDouble = l(a(1d),null);
- poalNumber = l(a(1),null);
- poalBigInteger = l(a(BigInteger.valueOf(1L)),null);
- poalBigDecimal = l(a(new BigDecimal("1")),null);
-
- // Regular list of primitives
- polBoolean = list();
- polBoolean.add(a(Boolean.TRUE));
- polBoolean.add(null);
- polByte = list();
- polByte.add(a((byte)1));
- polByte.add(null);
- polChar = list();
- polChar.add(a('a'));
- polChar.add(null);
- polShort = list();
- polShort.add(a((short)1));
- polShort.add(null);
- polInt = list();
- polInt.add(a(1));
- polInt.add(null);
- polLong = list();
- polLong.add(a(1L));
- polLong.add(null);
- polFloat = list();
- polFloat.add(a(1f));
- polFloat.add(null);
- polDouble = list();
- polDouble.add(a(1d));
- polDouble.add(null);
- polNumber = list();
- polNumber.add(a((Number)1));
- polNumber.add(null);
- polBigInteger = list();
- polBigInteger.add(a(BigInteger.valueOf(1L)));
- polBigInteger.add(null);
- polBigDecimal = list();
- polBigDecimal.add(a(new BigDecimal("1")));
- polBigDecimal.add(null);
-
- return this;
- }
-
- public static PrimitiveObjectsBean get() {
- return new PrimitiveObjectsBean().init();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java
deleted file mode 100644
index ef08e967b4..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-public enum TestEnum {
- ONE,TWO,THREE
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java
deleted file mode 100644
index f031afebc5..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.Utils.*;
-
-public enum TestEnumToString {
-
- ONE("one"), TWO("two"), THREE("three");
-
- private String val;
-
- TestEnumToString(String val) {
- this.val = val;
- }
-
- public static TestEnumToString fromString(String val) {
- for (var e : values())
- if (eq(e.val, val))
- return e;
- return null;
- }
-
- @Override
- public String toString() {
- return val;
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java
deleted file mode 100644
index bf13fe1caf..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.io.*;
-
-/**
- * Convenience class for capturing contents sent to a {@link PrintStream}
- */
-public class CapturingPrintStream extends PrintStream {
-
- public CapturingPrintStream() {
- super(new ByteArrayOutputStream(), true);
- }
-
- @Override
- public String toString() {
- return out.toString();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/Constants.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/Constants.java
deleted file mode 100644
index 9440017044..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/Constants.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-public class Constants {
-
- private Constants() {}
-
- public static final String SWAP = "swap-~!@#$%^&*()_+`-={}[]|:;\"<,>.?/";
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java
deleted file mode 100644
index 179bf6485e..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.time.*;
-
-import org.apache.juneau.commons.time.*;
-
-/**
- * A fake time provider for testing that always returns UTC timezone and a fixed time.
- */
-public class FakeTimeProvider extends TimeProvider {
-
- private static final ZoneId UTC = ZoneId.of("UTC");
- private static final ZonedDateTime FIXED_TIME = ZonedDateTime.of(2000, 1, 1, 12, 0, 0, 0, UTC);
-
- @Override
- public ZoneId getSystemDefaultZoneId() {
- return UTC;
- }
-
- @Override
- public ZonedDateTime now() {
- return FIXED_TIME;
- }
-
- @Override
- public ZonedDateTime now(ZoneId zoneId) {
- return FIXED_TIME.withZoneSameInstant(zoneId);
- }
-}
-
diff --git a/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java b/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java
deleted file mode 100644
index a862353fd4..0000000000
--- a/juneau-core/juneau-config/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.util.function.*;
-
-/**
- * A simple supplier of objects.
- */
-public class MutableSupplier<T> implements Supplier<T> {
- public T value;
-
- public static <T> MutableSupplier<T> of(T value) {
- return new MutableSupplier<T>().set(value);
- }
-
- public MutableSupplier<T> set(T value) {
- this.value = value;
- return this;
- }
-
- @Override
- public T get() {
- return value;
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-junit5/pom.xml b/juneau-core/juneau-junit5/pom.xml
index c08f15fb55..6ac9f4e625 100644
--- a/juneau-core/juneau-junit5/pom.xml
+++ b/juneau-core/juneau-junit5/pom.xml
@@ -52,6 +52,12 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-core/juneau-junit5/src/test/java/org/apache/juneau/TestBase.java b/juneau-core/juneau-junit5/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-core/juneau-junit5/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-core/juneau-marshall/pom.xml b/juneau-core/juneau-marshall/pom.xml
index a198340065..e604a8f5f6 100644
--- a/juneau-core/juneau-marshall/pom.xml
+++ b/juneau-core/juneau-marshall/pom.xml
@@ -64,6 +64,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/CloseableByteArrayInputStream.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/CloseableByteArrayInputStream.java
deleted file mode 100644
index 0a42dd3dc2..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/CloseableByteArrayInputStream.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import java.io.*;
-
-/**
- * A ByteArrayInputStream with a usable close() method.
- */
-public class CloseableByteArrayInputStream extends ByteArrayInputStream {
- boolean isClosed;
-
- public CloseableByteArrayInputStream(byte[] buf) {
- super(buf);
- }
-
- @Override
- public synchronized int read() {
- if (isClosed)
- throw new IllegalStateException("Stream is closed");
- return super.read();
- }
-
- @Override
- public void close() {
- isClosed = true;
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/CloseableStringReader.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/CloseableStringReader.java
deleted file mode 100644
index fb841baa80..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/CloseableStringReader.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import java.io.*;
-
-/**
- * A StringReader with a usable close() method.
- */
-public class CloseableStringReader extends StringReader {
- boolean isClosed;
-
- public CloseableStringReader(String in) {
- super(in);
- }
-
- private void checkOpen() {
- if (isClosed)
- throw new IllegalStateException("Reader is closed");
- }
-
- @Override
- public void close() {
- isClosed = true;
- }
-
- @Override
- public int read() throws IOException {
- checkOpen();
- return super.read();
- }
-
- @Override
- public int read(char[] cbuf, int off, int len) throws IOException {
- checkOpen();
- return super.read(cbuf, off, len);
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/TestBase.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/TestBase.java
deleted file mode 100644
index e594c27f25..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/TestBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import org.junit.jupiter.api.*;
-
-/**
- * Base test class that provides common test configuration for all test classes in the junit package.
- *
- * <p>This class configures test method ordering to use method names, ensuring consistent and predictable
- * test execution order across all test classes in the package.</p>
- */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-@TestClassOrder(ClassOrderer.ClassName.class)
-public abstract class TestBase {
- // Base class for common test configuration
-}
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/XVar.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/XVar.java
deleted file mode 100644
index fe115c6ce6..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/XVar.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import java.io.*;
-
-import org.apache.juneau.commons.svl.*;
-
-/**
- * Dummy variable for resolving <code>$X{...}</code> variables.
- */
-public class XVar extends Var {
-
- /**
- * Constructor.
- */
- public XVar() {
- super("X", false);
- }
-
- @Override
- public String resolve(VarResolverSession session, String arg) throws Exception {
- return arg;
- }
-
- @Override
- public void resolveTo(VarResolverSession session, Writer w, String arg) throws Exception {
- w.append(arg);
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java
deleted file mode 100755
index ef43049607..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveAtomicObjectsBean.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-
-import java.util.*;
-import java.util.concurrent.atomic.*;
-
-/**
- * Test bean fields of type AtomicInteger and AtomicLong.
- * Note that Jena parsers cannot handle these types, so we only test non-Jena parsers.
- */
-@SuppressWarnings({})
-public class PrimitiveAtomicObjectsBean {
-
- // primitive objects
- public AtomicInteger poAtomicInteger;
- public AtomicLong poAtomicLong;
-
- // uninitialized primitive objects
- public AtomicInteger pouAtomicInteger;
- public AtomicLong pouAtomicLong;
-
- // primitive object arrays
- public AtomicInteger[][] poaAtomicInteger;
- public AtomicLong[][] poaAtomicLong;
-
- // primitive object arrays
- public AtomicInteger[][] poauAtomicInteger;
- public AtomicLong[][] poauAtomicLong;
-
- // Anonymous list of primitives (types not erased on objects
- public List<AtomicInteger[]> poalAtomicInteger;
- public List<AtomicLong[]> poalAtomicLong;
-
- // Regular list of primitives (types erased on objects)
- public List<AtomicInteger[]> polAtomicInteger;
- public List<AtomicLong[]> polAtomicLong;
-
- private PrimitiveAtomicObjectsBean init() {
- // primitive objects
- poAtomicInteger = new AtomicInteger(1);
- poAtomicLong = new AtomicLong(2);
-
- // primitive object arrays
- poaAtomicInteger = a(a(new AtomicInteger(1)),a(new AtomicInteger(2)),null);
- poaAtomicLong = a(a(new AtomicLong(1)),a(new AtomicLong(2)),null);
-
- // Anonymous list of primitives
- poalAtomicInteger = l(a(new AtomicInteger(1)),null);
- poalAtomicLong = l(a(new AtomicLong(1)),null);
-
- // Regular list of primitives
- polAtomicInteger = list();
- polAtomicInteger.add(a(new AtomicInteger(1)));
- polAtomicInteger.add(null);
- polAtomicLong = list();
- polAtomicLong.add(a(new AtomicLong(1)));
- polAtomicLong.add(null);
-
- return this;
- }
-
- public static PrimitiveAtomicObjectsBean get() {
- return new PrimitiveAtomicObjectsBean().init();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java
deleted file mode 100755
index d3f6a1cf6b..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/PrimitiveObjectsBean.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-
-import java.math.*;
-import java.util.*;
-
-@SuppressWarnings({})
-public class PrimitiveObjectsBean {
-
- // primitive objects
- public Boolean poBoolean;
- public Byte poByte;
- public Character poChar;
- public Short poShort;
- public Integer poInt;
- public Long poLong;
- public Float poFloat;
- public Double poDouble;
- public Number poNumber;
- public BigInteger poBigInteger;
- public BigDecimal poBigDecimal;
-
- // uninitialized primitive objects
- public Boolean pouBoolean;
- public Byte pouByte;
- public Character pouChar;
- public Short pouShort;
- public Integer pouInt;
- public Long pouLong;
- public Float pouFloat;
- public Double pouDouble;
- public Number pouNumber;
- public BigInteger pouBigInteger;
- public BigDecimal pouBigDecimal;
-
- // primitive object arrays
- public Boolean[][] poaBoolean;
- public Byte[][] poaByte;
- public Character[][] poaChar;
- public Short[][] poaShort;
- public Integer[][] poaInt;
- public Long[][] poaLong;
- public Float[][] poaFloat;
- public Double[][] poaDouble;
- public Number[][] poaNumber;
- public BigInteger[][] poaBigInteger;
- public BigDecimal[][] poaBigDecimal;
-
- // primitive object arrays
- public Boolean[][] poauBoolean;
- public Byte[][] poauByte;
- public Character[][] poauChar;
- public Short[][] poauShort;
- public Integer[][] poauInt;
- public Long[][] poauLong;
- public Float[][] poauFloat;
- public Double[][] poauDouble;
- public Number[][] poauNumber;
- public BigInteger[][] poauBigInteger;
- public BigDecimal[][] poauBigDecimal;
-
- // Anonymous list of primitives (types not erased on objects
- public List<Boolean[]> poalBoolean;
- public List<Byte[]> poalByte;
- public List<Character[]> poalChar;
- public List<Short[]> poalShort;
- public List<Integer[]> poalInt;
- public List<Long[]> poalLong;
- public List<Float[]> poalFloat;
- public List<Double[]> poalDouble;
- public List<Number[]> poalNumber;
- public List<BigInteger[]> poalBigInteger;
- public List<BigDecimal[]> poalBigDecimal;
-
- // Regular list of primitives (types erased on objects)
- public List<Boolean[]> polBoolean;
- public List<Byte[]> polByte;
- public List<Character[]> polChar;
- public List<Short[]> polShort;
- public List<Integer[]> polInt;
- public List<Long[]> polLong;
- public List<Float[]> polFloat;
- public List<Double[]> polDouble;
- public List<Number[]> polNumber;
- public List<BigInteger[]> polBigInteger;
- public List<BigDecimal[]> polBigDecimal;
-
- private PrimitiveObjectsBean init() {
- // primitive objects
- poBoolean = true;
- poByte = 1;
- poChar = 'a';
- poShort = 2;
- poInt = 3;
- poLong = 4L;
- poFloat = 5f;
- poDouble = 6d;
- poNumber = 7;
- poBigInteger = BigInteger.valueOf(8L);
- poBigDecimal = new BigDecimal("9");
-
- // primitive object arrays
- poaBoolean = a(a(true),a(false),null);
- poaByte = a(a((byte)1),a((byte)2),null);
- poaChar = a(a('a'),a('b'),null);
- poaShort = a(a((short)1),a((short)2),null);
- poaInt = a(a(1),a(2),null);
- poaLong = a(a(1L),a(2L),null);
- poaFloat = a(a(1f),a(2f),null);
- poaDouble = a(a(1d),a(2d),null);
- poaNumber = a(a((Number)1),a((Number)2),null);
- poaBigInteger = a(a(BigInteger.valueOf(1L)),a(BigInteger.valueOf(2L)), null);
- poaBigDecimal = a(a(new BigDecimal("1")),a(new BigDecimal("2")), null);
-
- // Anonymous list of primitives
- poalBoolean = l(a(Boolean.TRUE),null);
- poalByte = l(a((byte)1),null);
- poalChar = l(a('a'),null);
- poalShort = l(a((short)1),null);
- poalInt = l(a(1),null);
- poalLong = l(a(1L),null);
- poalFloat = l(a(1f),null);
- poalDouble = l(a(1d),null);
- poalNumber = l(a(1),null);
- poalBigInteger = l(a(BigInteger.valueOf(1L)),null);
- poalBigDecimal = l(a(new BigDecimal("1")),null);
-
- // Regular list of primitives
- polBoolean = list();
- polBoolean.add(a(Boolean.TRUE));
- polBoolean.add(null);
- polByte = list();
- polByte.add(a((byte)1));
- polByte.add(null);
- polChar = list();
- polChar.add(a('a'));
- polChar.add(null);
- polShort = list();
- polShort.add(a((short)1));
- polShort.add(null);
- polInt = list();
- polInt.add(a(1));
- polInt.add(null);
- polLong = list();
- polLong.add(a(1L));
- polLong.add(null);
- polFloat = list();
- polFloat.add(a(1f));
- polFloat.add(null);
- polDouble = list();
- polDouble.add(a(1d));
- polDouble.add(null);
- polNumber = list();
- polNumber.add(a((Number)1));
- polNumber.add(null);
- polBigInteger = list();
- polBigInteger.add(a(BigInteger.valueOf(1L)));
- polBigInteger.add(null);
- polBigDecimal = list();
- polBigDecimal.add(a(new BigDecimal("1")));
- polBigDecimal.add(null);
-
- return this;
- }
-
- public static PrimitiveObjectsBean get() {
- return new PrimitiveObjectsBean().init();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java
deleted file mode 100644
index ef08e967b4..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/TestEnum.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-public enum TestEnum {
- ONE,TWO,THREE
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java
deleted file mode 100644
index f031afebc5..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/testutils/pojos/TestEnumToString.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.testutils.pojos;
-
-import static org.apache.juneau.commons.utils.Utils.*;
-
-public enum TestEnumToString {
-
- ONE("one"), TWO("two"), THREE("three");
-
- private String val;
-
- TestEnumToString(String val) {
- this.val = val;
- }
-
- public static TestEnumToString fromString(String val) {
- for (var e : values())
- if (eq(e.val, val))
- return e;
- return null;
- }
-
- @Override
- public String toString() {
- return val;
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java
deleted file mode 100644
index bf13fe1caf..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/CapturingPrintStream.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.io.*;
-
-/**
- * Convenience class for capturing contents sent to a {@link PrintStream}
- */
-public class CapturingPrintStream extends PrintStream {
-
- public CapturingPrintStream() {
- super(new ByteArrayOutputStream(), true);
- }
-
- @Override
- public String toString() {
- return out.toString();
- }
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/Constants.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/Constants.java
deleted file mode 100644
index 9440017044..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/Constants.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-public class Constants {
-
- private Constants() {}
-
- public static final String SWAP = "swap-~!@#$%^&*()_+`-={}[]|:;\"<,>.?/";
-}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java
deleted file mode 100644
index 179bf6485e..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/FakeTimeProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.time.*;
-
-import org.apache.juneau.commons.time.*;
-
-/**
- * A fake time provider for testing that always returns UTC timezone and a fixed time.
- */
-public class FakeTimeProvider extends TimeProvider {
-
- private static final ZoneId UTC = ZoneId.of("UTC");
- private static final ZonedDateTime FIXED_TIME = ZonedDateTime.of(2000, 1, 1, 12, 0, 0, 0, UTC);
-
- @Override
- public ZoneId getSystemDefaultZoneId() {
- return UTC;
- }
-
- @Override
- public ZonedDateTime now() {
- return FIXED_TIME;
- }
-
- @Override
- public ZonedDateTime now(ZoneId zoneId) {
- return FIXED_TIME.withZoneSameInstant(zoneId);
- }
-}
-
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java
deleted file mode 100644
index a862353fd4..0000000000
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/utest/utils/MutableSupplier.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.utest.utils;
-
-import java.util.function.*;
-
-/**
- * A simple supplier of objects.
- */
-public class MutableSupplier<T> implements Supplier<T> {
- public T value;
-
- public static <T> MutableSupplier<T> of(T value) {
- return new MutableSupplier<T>().set(value);
- }
-
- public MutableSupplier<T> set(T value) {
- this.value = value;
- return this;
- }
-
- @Override
- public T get() {
- return value;
- }
-}
\ No newline at end of file
diff --git a/juneau-core/pom.xml b/juneau-core/pom.xml
index b6821e41f1..bd88681a91 100644
--- a/juneau-core/pom.xml
+++ b/juneau-core/pom.xml
@@ -32,6 +32,7 @@
<modules>
<module>juneau-commons</module>
+ <module>juneau-test-utils</module>
<module>juneau-marshall</module>
<module>juneau-marshall-rdf</module>
<module>juneau-config</module>
diff --git a/juneau-microservice/juneau-microservice-jetty/logs/jetty-requests.log.010714689 b/juneau-microservice/juneau-microservice-jetty/logs/jetty-requests.log.010714689
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/juneau-rest/juneau-rest-client-apache-httpclient-45/pom.xml b/juneau-rest/juneau-rest-client-apache-httpclient-45/pom.xml
index b1c8461efc..c61b86606c 100644
--- a/juneau-rest/juneau-rest-client-apache-httpclient-45/pom.xml
+++ b/juneau-rest/juneau-rest-client-apache-httpclient-45/pom.xml
@@ -45,6 +45,12 @@
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/client/ApacheHc45Transport_Test.java b/juneau-rest/juneau-rest-client-apache-httpclient-45/src/test/java/org/apache/juneau/rest/client/ApacheHc45Transport_Test.java
similarity index 100%
rename from juneau-utest/src/test/java/org/apache/juneau/rest/client/ApacheHc45Transport_Test.java
rename to juneau-rest/juneau-rest-client-apache-httpclient-45/src/test/java/org/apache/juneau/rest/client/ApacheHc45Transport_Test.java
diff --git a/juneau-rest/juneau-rest-client-apache-httpclient-50/pom.xml b/juneau-rest/juneau-rest-client-apache-httpclient-50/pom.xml
index ecf8effa5b..d83e31258c 100644
--- a/juneau-rest/juneau-rest-client-apache-httpclient-50/pom.xml
+++ b/juneau-rest/juneau-rest-client-apache-httpclient-50/pom.xml
@@ -45,6 +45,12 @@
<artifactId>httpclient5</artifactId>
<version>5.6.1</version>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/client/ApacheHc5Transport_Test.java b/juneau-rest/juneau-rest-client-apache-httpclient-50/src/test/java/org/apache/juneau/rest/client/ApacheHc5Transport_Test.java
similarity index 100%
rename from juneau-utest/src/test/java/org/apache/juneau/rest/client/ApacheHc5Transport_Test.java
rename to juneau-rest/juneau-rest-client-apache-httpclient-50/src/test/java/org/apache/juneau/rest/client/ApacheHc5Transport_Test.java
diff --git a/juneau-rest/juneau-rest-client-classic/pom.xml b/juneau-rest/juneau-rest-client-classic/pom.xml
index 23503165b9..2aad68223a 100644
--- a/juneau-rest/juneau-rest-client-classic/pom.xml
+++ b/juneau-rest/juneau-rest-client-classic/pom.xml
@@ -50,6 +50,12 @@
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/client/classic/remote/RemoteOperationArg_Test.java b/juneau-rest/juneau-rest-client-classic/src/test/java/org/apache/juneau/rest/client/classic/remote/RemoteOperationArg_Test.java
similarity index 100%
rename from juneau-utest/src/test/java/org/apache/juneau/rest/client/classic/remote/RemoteOperationArg_Test.java
rename to juneau-rest/juneau-rest-client-classic/src/test/java/org/apache/juneau/rest/client/classic/remote/RemoteOperationArg_Test.java
diff --git a/juneau-rest/juneau-rest-client-jetty/pom.xml b/juneau-rest/juneau-rest-client-jetty/pom.xml
index 58896befbb..0cc9c65f4d 100644
--- a/juneau-rest/juneau-rest-client-jetty/pom.xml
+++ b/juneau-rest/juneau-rest-client-jetty/pom.xml
@@ -45,6 +45,12 @@
<artifactId>jetty-client</artifactId>
<version>${jetty.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/client/JettyHttpTransport_Test.java b/juneau-rest/juneau-rest-client-jetty/src/test/java/org/apache/juneau/rest/client/JettyHttpTransport_Test.java
similarity index 100%
rename from juneau-utest/src/test/java/org/apache/juneau/rest/client/JettyHttpTransport_Test.java
rename to juneau-rest/juneau-rest-client-jetty/src/test/java/org/apache/juneau/rest/client/JettyHttpTransport_Test.java
diff --git a/juneau-rest/juneau-rest-client-okhttp/pom.xml b/juneau-rest/juneau-rest-client-okhttp/pom.xml
index 1c3a9b5367..3aca3750d4 100644
--- a/juneau-rest/juneau-rest-client-okhttp/pom.xml
+++ b/juneau-rest/juneau-rest-client-okhttp/pom.xml
@@ -45,6 +45,12 @@
<artifactId>okhttp-jvm</artifactId>
<version>5.3.2</version>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/client/OkHttpTransport_Test.java b/juneau-rest/juneau-rest-client-okhttp/src/test/java/org/apache/juneau/rest/client/OkHttpTransport_Test.java
similarity index 100%
rename from juneau-utest/src/test/java/org/apache/juneau/rest/client/OkHttpTransport_Test.java
rename to juneau-rest/juneau-rest-client-okhttp/src/test/java/org/apache/juneau/rest/client/OkHttpTransport_Test.java
diff --git a/juneau-rest/juneau-rest-client/pom.xml b/juneau-rest/juneau-rest-client/pom.xml
index 12d47bc3f8..b1f86a8e38 100644
--- a/juneau-rest/juneau-rest-client/pom.xml
+++ b/juneau-rest/juneau-rest-client/pom.xml
@@ -40,6 +40,12 @@
<artifactId>juneau-rest-common</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/client/JavaHttpTransport_Test.java b/juneau-rest/juneau-rest-client/src/test/java/org/apache/juneau/rest/client/JavaHttpTransport_Test.java
similarity index 100%
rename from juneau-utest/src/test/java/org/apache/juneau/rest/client/JavaHttpTransport_Test.java
rename to juneau-rest/juneau-rest-client/src/test/java/org/apache/juneau/rest/client/JavaHttpTransport_Test.java
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/jakarta/inject/Inject.java b/juneau-rest/juneau-rest-mock/src/test/java/jakarta/inject/Inject.java
deleted file mode 100644
index 7028b5311e..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/jakarta/inject/Inject.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package jakarta.inject;
-
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.*;
-
-import java.lang.annotation.*;
-
-/**
- * Test-only stand-in for JSR-330's <code>jakarta.inject.Inject</code>.
- *
- * <p>The {@code commons.inject} framework recognizes injection-related annotations by
- * <strong>fully qualified name</strong>, not by simple class name. To exercise the JSR-330
- * interop path without pulling in a real {@code jakarta.inject-api} dependency, this mirror
- * declares an annotation at the canonical FQN {@code jakarta.inject.Inject}.
- *
- * <p>Limited to the test classpath; never package this in a published artifact.
- */
-@Retention(RUNTIME)
-@Target({FIELD, METHOD, CONSTRUCTOR})
-public @interface Inject {}
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/BeanTester.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/BeanTester.java
deleted file mode 100644
index 330cfbbafa..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/BeanTester.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-import static org.apache.juneau.marshall.marshaller.MarshallUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import org.apache.juneau.junit.bct.*;
-
-/**
- * Utility class for testing bean functionality in a standardized way.
- *
- * <p>
- * This class provides a fluent API for setting up and executing common bean tests including:
- * <ul>
- * <li>Getter/setter validation using {@link BctAssertions#assertBean(Object, String, String)}
- * <li>Copy constructor/method testing
- * <li>JSON serialization/deserialization testing
- * <li>Round-trip serialization testing
- * <li>toString() method validation
- * </ul>
- *
- * <h5 class='section'>Example Usage:</h5>
- * <p class='bjava'>
- * BeanTester<MyBean> tester = testBean(myBean)
- * .json("{prop1:'value1',prop2:'value2'}")
- * .props("prop1,prop2")
- * .vals("'value1','value2'")
- * .string("{prop1:'value1',prop2:'value2'}");
- *
- * tester.assertGettersAndSetters();
- * tester.assertToJson();
- * tester.assertFromJson();
- * tester.assertRoundTrip();
- * tester.assertToString();
- * </p>
- *
- * <p>
- * This class is typically used in nested test classes to provide consistent testing patterns
- * across different bean types in the Apache Juneau project.
- *
- * @param <T> The type of bean being tested
- */
-@SuppressWarnings({
- "unchecked", // Class<T> cast for generic bean type in test utility
- "javadoc", // {@link BctAssertions} references not resolvable in this module's classpath
- "unused" // jsonRoundTrip is a private utility method retained for completeness
-})
-public class BeanTester<T> {
-
- private T bean;
- private Class<T> c;
-
- /**
- * Sets the bean instance to be tested.
- *
- * @param value The bean instance to test.
- * @return This object for method chaining.
- */
- public BeanTester<T> bean(T value) { bean = value; c = (Class<T>) bean.getClass(); return this; }
-
- /**
- * Returns the bean instance being tested.
- *
- * @return The bean instance being tested.
- */
- public T bean() { return bean; }
-
- private String json;
-
- /**
- * Sets the expected JSON representation of the bean.
- *
- * <p>
- * This JSON string is used by {@link #assertToJson()} to verify that the bean
- * serializes to the expected JSON format, and by {@link #assertFromJson()} to
- * verify that the JSON deserializes back to an equivalent bean.
- *
- * @param value The expected JSON representation.
- * @return This object for method chaining.
- */
- public BeanTester<T> json(String value) { json = value; return this; }
-
- /**
- * Returns the expected JSON representation of the bean.
- *
- * @return The expected JSON representation.
- */
- public String json() { return json; }
-
- private String props;
-
- /**
- * Sets the comma-delimited list of property names for bean validation.
- *
- * <p>
- * This string is used by {@link BctAssertions#assertBean(Object, String, String)} to
- * validate that the bean has the expected properties with the expected values.
- * Property names should be listed in the same order as their corresponding values
- * in the {@link #vals(String)} parameter.
- *
- * @param value Comma-delimited list of property names (e.g., "prop1,prop2,prop3").
- * @return This object for method chaining.
- */
- public BeanTester<T> props(String value) { props = value; return this; }
-
- /**
- * Returns the comma-delimited list of property names.
- *
- * @return The comma-delimited list of property names.
- */
- public String props() { return props; }
-
- private String vals;
-
- /**
- * Sets the comma-delimited list of expected property values for bean validation.
- *
- * <p>
- * This string is used by {@link BctAssertions#assertBean(Object, String, String)} to
- * validate that the bean properties have the expected values. Values should be
- * listed in the same order as their corresponding property names in the
- * {@link #props(String)} parameter. String values should be quoted (e.g., "'value'").
- *
- * @param value Comma-delimited list of expected values (e.g., "'value1','value2',123").
- * @return This object for method chaining.
- */
- public BeanTester<T> vals(String value) { vals = value; return this; }
-
- /**
- * Returns the comma-delimited list of expected property values.
- *
- * @return The comma-delimited list of expected property values.
- */
- public String vals() { return vals; }
-
- private String string;
-
- /**
- * Sets the expected string representation of the bean.
- *
- * <p>
- * This string is used by {@link #assertToString()} to verify that the bean's
- * {@code toString()} method returns the expected value.
- *
- * @param value The expected string representation.
- * @return This object for method chaining.
- */
- public BeanTester<T> string(String value) { string = value; return this; }
-
- /**
- * Returns the expected string representation of the bean.
- *
- * @return The expected string representation.
- */
- public String string() { return string; }
-
- /**
- * Validates that the bean's getters and setters work correctly.
- *
- * <p>
- * This method uses {@link BctAssertions#assertBean(Object, String, String)} to verify
- * that the bean's properties match the expected values specified by {@link #props(String)}
- * and {@link #vals(String)}.
- *
- * @throws AssertionError if any property values don't match expectations.
- */
- public void assertGettersAndSetters() {
- assertBean(bean, props, vals);
- }
-
- /**
- * Validates that the bean's copy constructor or copy() method works correctly.
- *
- * <p>
- * This method uses reflection to invoke the bean's {@code copy()} method, then verifies:
- * <ul>
- * <li>The returned object is not the same instance as the original
- * <li>The returned object has the same property values as the original
- * </ul>
- *
- * @throws AssertionError if the copy is the same instance or has different property values.
- * @throws RuntimeException if the bean doesn't have a {@code copy()} method or it fails to invoke.
- */
- public void assertCopy() {
- var t = safe(()->bean.getClass().getMethod("copy").invoke(bean));
- assertNotSame(bean, t);
- assertBean(t, props, vals);
- }
-
- /**
- * Validates that the bean serializes to the expected JSON format.
- *
- * <p>
- * This method uses {@link TestUtils#assertJson(String, Object)} to verify that
- * the bean serializes to the JSON string specified by {@link #json(String)}.
- *
- * @throws AssertionError if the serialized JSON doesn't match the expected format.
- */
- public void assertToJson() {
- assertJson(json, bean);
- }
-
- /**
- * Validates that the expected JSON deserializes to a bean with correct property values.
- *
- * <p>
- * This method deserializes the JSON string specified by {@link #json(String)} and
- * verifies that the resulting bean has the expected property values specified by
- * {@link #props(String)} and {@link #vals(String)}.
- *
- * @throws AssertionError if the deserialized bean doesn't have the expected property values.
- * @throws RuntimeException if JSON deserialization fails.
- */
- public void assertFromJson() {
- assertBean(json(json, c), props, vals);
- }
-
- /**
- * Validates that the bean can be serialized to JSON and deserialized back correctly.
- *
- * <p>
- * This method performs a complete round-trip test by:
- * <ol>
- * <li>Serializing the bean to JSON
- * <li>Deserializing the JSON back to a bean
- * <li>Verifying the resulting bean has the expected property values
- * </ol>
- *
- * @throws AssertionError if the round-trip bean doesn't have the expected property values.
- * @throws RuntimeException if serialization or deserialization fails.
- */
- public void assertRoundTrip() {
- assertBean(jsonRoundTrip(bean, c), props, vals);
- }
-
- /**
- * Validates that the bean's toString() method returns the expected string.
- *
- * <p>
- * This method compares the bean's {@code toString()} output with the string
- * specified by {@link #string(String)}.
- *
- * @throws AssertionError if the toString() output doesn't match the expected string.
- */
- public void assertToString() {
- assertEquals(string, bean.toString());
- }
-
- /**
- * Serializes an object to JSON using the default sorted JSON serializer.
- *
- * @param o The object to serialize.
- * @return The JSON representation of the object.
- */
- private static String json(Object o) {
- return json5(o);
- }
-
- /**
- * Deserializes a JSON string to an object of the specified type.
- *
- * @param <T> The type to deserialize to.
- * @param o The JSON string to deserialize.
- * @param c The class to deserialize to.
- * @return The deserialized object.
- */
- private static <T> T json(String o, Class<T> c) {
- return safe(()->json5(o, c));
- }
-
- /**
- * Performs a round-trip serialization/deserialization test.
- *
- * @param <T> The type of object to round-trip.
- * @param o The object to serialize and deserialize.
- * @param c The class to deserialize to.
- * @return The object after round-trip serialization/deserialization.
- */
- private static <T> T jsonRoundTrip(T o, Class<T> c) {
- return json(json(o), c);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/TestUtils.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/TestUtils.java
deleted file mode 100644
index 89919a81cb..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/TestUtils.java
+++ /dev/null
@@ -1,540 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau;
-
-import static java.util.stream.Collectors.*;
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import static org.apache.juneau.commons.utils.ThrowableUtils.*;
-import static org.apache.juneau.marshall.marshaller.MarshallUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.net.*;
-import java.util.*;
-import java.util.regex.*;
-import java.util.stream.*;
-
-import org.apache.juneau.bean.swagger.Swagger;
-import org.apache.juneau.commons.bean.*;
-import org.apache.juneau.commons.utils.*;
-import org.apache.juneau.junit.bct.*;
-import org.apache.juneau.marshall.serializer.*;
-import org.apache.juneau.marshall.xml.*;
-import org.apache.juneau.rest.mock.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-/**
- * Comprehensive utility class for Bean-Centric Tests (BCT) and general testing operations.
- *
- * <p>This class provides the core testing infrastructure for Apache Juneau, with particular emphasis
- * on the Bean-Centric Testing (BCT) framework. BCT enables sophisticated assertion patterns for
- * testing object properties, collections, maps, and complex nested structures with minimal code.</p>
- *
- * <h5 class='section'>Bean-Centric Testing (BCT) Framework:</h5>
- * <p>The BCT framework consists of several key components:</p>
- * <ul>
- * <li><b>{@link BeanConverter}:</b> Core interface for object conversion and property access</li>
- * <li><b>{@link BasicBeanConverter}:</b> Default implementation with extensible type handlers</li>
- * <li><b>Assertion Methods:</b> High-level testing methods that leverage the converter framework</li>
- * </ul>
- *
- * <h5 class='section'>Primary BCT Assertion Methods:</h5>
- * These static methods are defined on {@link BctAssertions} and typically used via
- * {@code import static org.apache.juneau.marshall.junit.bct.BctAssertions.*;} (also re-exported through {@link TestBase}).
- * </p>
- * <dl>
- * <dt><b>{@link BctAssertions#assertBean(Object, String, String)}</b></dt>
- * <dd>Tests object properties with nested syntax support and collection iteration</dd>
- *
- * <dt><b>{@link BctAssertions#assertMap(java.util.Map, Object...)}</b></dt>
- * <dd>Tests map entries with the same nested property syntax as assertBean</dd>
- *
- * <dt><b>{@link BctAssertions#assertMapped(Object, java.util.function.BiFunction, String, String)}</b></dt>
- * <dd>Tests custom property access using BiFunction for non-standard objects</dd>
- *
- * <dt><b>{@link BctAssertions#assertList(Object, Object...)}</b></dt>
- * <dd>Tests list/collection elements with varargs for expected values</dd>
- *
- * <dt><b>{@link BctAssertions#assertBeans(Object, String, String...)}</b></dt>
- * <dd>Tests collections of objects by extracting and comparing specific fields</dd>
- * </dl>
- *
- * <h5 class='section'>BCT Advanced Features:</h5>
- * <ul>
- * <li><b>Nested Property Syntax:</b> "address{street,city}" for testing nested objects</li>
- * <li><b>Collection Iteration:</b> "#{property}" syntax for testing all elements</li>
- * <li><b>Universal Size Properties:</b> "length" and "size" work on all collection types</li>
- * <li><b>Array/List Access:</b> Numeric indices for element-specific testing</li>
- * <li><b>Method Chaining:</b> Fluent setters can be tested directly</li>
- * <li><b>Direct Field Access:</b> Public fields accessed without getters</li>
- * <li><b>Map Key Access:</b> Including special "<NULL>" syntax for null keys</li>
- * </ul>
- *
- * <h5 class='section'>Converter Extensibility:</h5>
- * <p>The BCT framework is built on the extensible {@link BasicBeanConverter} which allows:</p>
- * <ul>
- * <li><b>Custom Stringifiers:</b> Type-specific string conversion logic</li>
- * <li><b>Custom Listifiers:</b> Collection-type conversion for iteration</li>
- * <li><b>Custom Swapifiers:</b> Object transformation before conversion</li>
- * <li><b>Configurable Settings:</b> Formatting, delimiters, and display options</li>
- * </ul>
- *
- * <h5 class='section'>Usage Examples:</h5>
- *
- * <p><b>Basic Property Testing:</b></p>
- * <p class='bjava'>
- * <jc>// Test multiple properties</jc>
- * assertBean(user, <js>"name,age,active"</js>, <js>"John,30,true"</js>);
- *
- * <jc>// Test nested properties</jc>
- * assertBean(user, <js>"address{street,city}"</js>, <js>"{123 Main St,Springfield}"</js>);
- * </p>
- *
- * <p><b>Collection and Array Testing:</b></p>
- * <p class='bjava'>
- * <jc>// Test collection size and iterate over all elements</jc>
- * assertBean(order, <js>"items{length,#{name}}"</js>, <js>"{3,[{Laptop},{Phone},{Tablet}]}"</js>);
- *
- * <jc>// Test specific array elements</jc>
- * assertBean(data, <js>"values{0,1,2}"</js>, <js>"{100,200,300}"</js>);
- * </p>
- *
- * <p><b>Map and Collection Testing:</b></p>
- * <p class='bjava'>
- * <jc>// Test map entries</jc>
- * assertMap(config, <js>"timeout,retries"</js>, <js>"30000,3"</js>);
- *
- * <jc>// Test list elements</jc>
- * assertList(tags, <js>"red"</js>, <js>"green"</js>, <js>"blue"</js>);
- * </p>
- *
- * <p><b>Custom Property Access:</b></p>
- * <p class='bjava'>
- * <jc>// Test with custom accessor function</jc>
- * assertMapped(myObject, (obj, prop) -> obj.getProperty(prop),
- * <js>"prop1,prop2"</js>, <js>"value1,value2"</js>);
- * </p>
- *
- * <h5 class='section'>Performance and Thread Safety:</h5>
- * <p>The BCT framework is designed for high performance with:</p>
- * <ul>
- * <li><b>Caching:</b> Type-to-handler mappings cached for fast lookup</li>
- * <li><b>Thread Safety:</b> All operations are thread-safe for concurrent testing</li>
- * <li><b>Minimal Allocation:</b> Efficient object reuse and minimal temporary objects</li>
- * </ul>
- *
- * @see BeanConverter
- * @see BasicBeanConverter
- */
-@SuppressWarnings({
- "unchecked", // BeanTester cast and generic type handling in test utilities
- "java:S1172", // Parameters kept for consistent method signatures across test utilities
- "javadoc" // {@link BctAssertions}, {@link BeanConverter}, {@link BasicBeanConverter} references not resolvable in this module
-})
-public class TestUtils extends Utils {
-
- private static final ThreadLocal<TimeZone> SYSTEM_TIME_ZONE = new ThreadLocal<>();
-
- public static final ThreadLocal<Locale> SYSTEM_LOCALE = new ThreadLocal<>();
-
-
- public static void assertEqualsAll(Object...values) {
- for (var i = 1; i < values.length; i++) {
- assertEquals(values[0], values[i], fs("Elements at index {0} and {1} did not match. {0}={2}, {1}={3}", 0, i, r(values[0]), r(values[i])));
- }
- }
-
- /**
- * Asserts the JSON5 representation of the specified object.
- */
- public static void assertJson(String expected, Object value) {
- assertEquals(expected, json5(value));
- }
-
- /**
- * Converts the specified object to a string and then replaces any newlines with pipes for easy comparison during testing.
- * @param value
- */
- public static String pipedLines(Object value) {
- return r(value).replaceAll("\\r?\\n", "|");
- }
-
-
- public static void assertNotEqualsAny(Object actual, Object...values) {
- assertNotNull(actual, "Value was null.");
- for (var i = 0; i < values.length; i++) {
- assertNotEquals(values[i], actual, fs("Element at index {0} unexpectedly matched. expected={1}, actual={2}", i, values[i], s(actual)));
- }
- }
-
- /**
- * Asserts the serialized representation of the specified object.
- */
- public static void assertSerialized(Object actual, WriterSerializer s, String expected) {
- assertEquals(expected, s.toString(actual));
- }
-
- @SuppressWarnings("unused") // expectedType kept for caller-site type documentation; only the message substring is checked at runtime
- public static <T extends Throwable> T assertThrowable(Class<? extends Throwable> expectedType, String expectedSubstring, T t) {
- var messages = getMessages(t);
- assertTrue(messages.contains(expectedSubstring), fs("Expected message to contain: {0}.\nActual:\n{1}", expectedSubstring, messages));
- return t;
- }
-
- public static <T extends Throwable> T assertThrowsWithMessage(Class<T> expectedType, List<String> expectedSubstrings, org.junit.jupiter.api.function.Executable executable) {
- var exception = Assertions.assertThrows(expectedType, executable);
- var messages = getMessages(exception);
- expectedSubstrings.forEach(x -> assertTrue(messages.contains(x), fs("Expected message to contain: {0}.\nActual:\n{1}", x, messages)));
- return exception;
- }
-
- public static <T extends Throwable> T assertThrowsWithMessage(Class<T> expectedType, String expectedSubstring, org.junit.jupiter.api.function.Executable executable) {
- var exception = Assertions.assertThrows(expectedType, executable);
- var messages = getMessages(exception);
- assertTrue(messages.contains(expectedSubstring), fs("Expected message to contain: {0}.\nActual:\n{1}", expectedSubstring, messages));
- return exception;
- }
-
- /**
- * Validates that the whitespace is correct in the specified XML.
- */
- public static final void checkXmlWhitespace(String out) throws SerializeException {
- if (out.indexOf('\u0000') != -1) {
- for (var s : out.split("\u0000"))
- checkXmlWhitespace(s);
- return;
- }
-
- var indent = -1;
- var startTag = Pattern.compile("^(\\s*)<[^/>]+(\\s+\\S+=['\"]\\S*['\"])*\\s*>$");
- var endTag = Pattern.compile("^(\\s*)</[^>]+>$");
- var combinedTag = Pattern.compile("^(\\s*)<[^>/]+(\\s+\\S+=['\"]\\S*['\"])*\\s*/>$");
- var contentOnly = Pattern.compile("^(\\s*)[^\\s\\<]+$");
- var tagWithContent = Pattern.compile("^(\\s*)<[^>]+>.*</[^>]+>$");
- var lines = out.split("\n");
- try {
- for (var i = 0; i < lines.length; i++) {
- var line = lines[i];
- var m = startTag.matcher(line);
- if (m.matches()) {
- indent++;
- if (m.group(1).length() != indent)
- throw new SerializeException("Wrong indentation detected on start tag line ''{0}''", i+1);
- continue;
- }
- m = endTag.matcher(line);
- if (m.matches()) {
- if (m.group(1).length() != indent)
- throw new SerializeException("Wrong indentation detected on end tag line ''{0}''", i+1);
- indent--;
- continue;
- }
- m = combinedTag.matcher(line);
- if (m.matches()) {
- indent++;
- if (m.group(1).length() != indent)
- throw new SerializeException("Wrong indentation detected on combined tag line ''{0}''", i+1);
- indent--;
- continue;
- }
- m = contentOnly.matcher(line);
- if (m.matches()) {
- indent++;
- if (m.group(1).length() != indent)
- throw new SerializeException("Wrong indentation detected on content-only line ''{0}''", i+1);
- indent--;
- continue;
- }
- m = tagWithContent.matcher(line);
- if (m.matches()) {
- indent++;
- if (m.group(1).length() != indent)
- throw new SerializeException("Wrong indentation detected on tag-with-content line ''{0}''", i+1);
- indent--;
- continue;
- }
- throw new SerializeException("Unmatched whitespace line at line number ''{0}''", i+1);
- }
- if (indent != -1)
- throw new SerializeException("Possible unmatched tag. indent=''{0}''", indent);
- } catch (SerializeException e) {
- printLines(lines);
- throw e;
- }
- }
-
- /**
- * Returns the value of the specified field/property on the specified object.
- * First looks for getter, then looks for field.
- * Methods and fields can be any visibility.
- */
- public static Object getBeanProp(Object o, String name) {
- return safe(() -> {
- var f = (Field)null;
- var c = o.getClass();
- var n = Character.toUpperCase(name.charAt(0)) + name.substring(1);
- var m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("is"+n) && x.getParameterCount() == 0 && x.getAnnotation(BeanIgnore.class) == null).findFirst().orElse(null);
- if (m != null) {
- m.setAccessible(true);
- return m.invoke(o);
- }
- m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("get"+n) && x.getParameterCount() == 0 && x.getAnnotation(BeanIgnore.class) == null).findFirst().orElse(null);
- if (m != null) {
- m.setAccessible(true);
- return m.invoke(o);
- }
- m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("get") && x.getParameterCount() == 1 && x.getParameterTypes()[0] == String.class && x.getAnnotation(BeanIgnore.class) == null).findFirst().orElse(null);
- if (m != null) {
- m.setAccessible(true);
- return m.invoke(o, name);
- }
- var c2 = c;
- while (f == null && c2 != null) {
- f = Arrays.stream(c2.getDeclaredFields()).filter(x -> x.getName().equals(name)).findFirst().orElse(null);
- c2 = c2.getSuperclass();
- }
- if (f != null) {
- f.setAccessible(true);
- return f.get(o);
- }
- m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals(name) && x.getParameterCount() == 0).findFirst().orElse(null);
- if (m != null) {
- m.setAccessible(true);
- return m.invoke(o);
- }
- throw rex("Property {0} not found on object of type {1}", name, cn(o));
- });
- }
-
- private static String getMessages(Throwable t) {
- return Stream.iterate(t, Throwable::getCause).takeWhile(e -> e != null).map(Throwable::getMessage).collect(joining("\n"));
- }
-
- /**
- * Gets the swagger for the specified @Resource-annotated object.
- */
- public static Swagger getSwagger(Class<?> c) {
- try {
- var r = c.getDeclaredConstructor().newInstance();
- var rc = new RestContext(new RestContext.Args(r.getClass(), null, null, () -> r, "", null, null, null, false));
- var ctx = new RestOpContext(TestUtils.class.getMethod("getSwagger", Class.class), rc);
- var session = RestSession.create(rc).resource(r).req(new MockServletRequest()).res(new MockServletResponse()).build();
- var req = ctx.createRequest(session);
- var ip = rc.getSwaggerProvider();
- return ip.getSwagger(rc, req.getLocale());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Creates an input stream from the specified string.
- *
- * @param in The contents of the reader.
- * @return A new input stream.
- */
- public static final ByteArrayInputStream inputStream(String in) {
- return new ByteArrayInputStream(in.getBytes());
- }
-
- public static String json(Object o) {
- return json5(o);
- }
-
- public static <T> T json(String o, Class<T> c) {
- return safe(()->json5(o, c));
- }
-
- public static <T> T jsonRoundTrip(T o, Class<T> c) {
- return json(json(o), c);
- }
-
- /**
- * Creates a reader from the specified string.
- *
- * @param in The contents of the reader.
- * @return A new reader.
- */
- public static final StringReader reader(String in) {
- return new StringReader(in);
- }
-
- /**
- * Temporarily sets the default system locale to the specified locale.
- * Use {@link #unsetLocale()} to unset it.
- *
- * @param v The locale to use as the default until {@link #unsetLocale()} is called.
- */
- public static final void setLocale(Locale v) {
- SYSTEM_LOCALE.set(Locale.getDefault());
- Locale.setDefault(v);
- }
-
- /**
- * Temporarily sets the default system timezone to the specified timezone ID.
- * Use {@link #unsetTimeZone()} to unset it.
- *
- * @param v The timezone ID passed to {@link TimeZone#getTimeZone(String)}.
- */
- public static final synchronized void setTimeZone(String v) {
- SYSTEM_TIME_ZONE.set(TimeZone.getDefault());
- TimeZone.setDefault(TimeZone.getTimeZone(v));
- }
-
- public static final void unsetLocale() {
- Locale.setDefault(SYSTEM_LOCALE.get());
- }
-
- public static final synchronized void unsetTimeZone() {
- TimeZone.setDefault(SYSTEM_TIME_ZONE.get());
- }
-
- /**
- * Constructs a {@link URL} object from a string.
- */
- public static URL url(String value) {
- return safe(()->new URI(value).toURL());
- }
-
- /**
- * Test whitespace and generated schema.
- */
- public static final void validateXml(Object o) throws Exception {
- validateXml(o, XmlSerializer.DEFAULT_NS_SQ);
- }
-
- /**
- * Test whitespace and generated schema.
- */
- public static final void validateXml(Object o, XmlSerializer s) throws Exception {
- s = s.copy().ws().ns().addNamespaceUrisToRoot().build();
- var xml = s.serialize(o);
- checkXmlWhitespace(xml);
- }
-
- public static final <T> BeanTester<T> testBean(T bean) {
- return (BeanTester<T>) new BeanTester<>().bean(bean);
- }
-
- /**
- * Extracts HTML/XML elements from a string based on element name and attributes.
- *
- * <p>Uses a depth-tracking parser to handle nested elements correctly, even with malformed HTML.</p>
- *
- * <h5 class='section'>Examples:</h5>
- * <pre>
- * // Extract all div elements with class='tag-block'
- * List<String> blocks = extractXml(html, "div", Map.of("class", "tag-block"));
- *
- * // Extract all span elements (no attribute filtering)
- * List<String> spans = extractXml(html, "span", null);
- *
- * // Extract divs with multiple attributes
- * List<String> divs = extractXml(html, "div", Map.of("class", "header", "id", "main"));
- * </pre>
- *
- * @param html The HTML/XML content to parse
- * @param elementName The element name to extract (e.g., "div", "span")
- * @param withAttributes Optional map of attribute name/value pairs that must match.
- * Pass null or empty map to match all elements of the given name.
- * @return List of HTML content strings (inner content of matching elements)
- */
- public static List<String> extractXml(String html, String elementName, Map<String,String> withAttributes) {
- List<String> results = list(); // NOAI
-
- if (html == null || elementName == null) {
- return results;
- }
-
- // Find all opening tags of the specified element
- var openTag = "<" + elementName;
- int searchPos = 0;
-
- while ((searchPos = html.indexOf(openTag, searchPos)) != -1) {
- // Find the end of the opening tag
- int tagEnd = html.indexOf('>', searchPos);
- if (tagEnd == -1) break;
-
- var fullOpenTag = html.substring(searchPos, tagEnd + 1);
-
- // Check if attributes match
- var matches = true;
- if (withAttributes != null && !withAttributes.isEmpty()) {
- for (var entry : withAttributes.entrySet()) {
- var attrName = entry.getKey();
- var attrValue = entry.getValue();
-
- // Look for attribute in the tag (handle both single and double quotes)
- var pattern1 = attrName + "=\"" + attrValue + "\"";
- var pattern2 = attrName + "='" + attrValue + "'";
-
- if (!fullOpenTag.contains(pattern1) && !fullOpenTag.contains(pattern2)) {
- matches = false;
- break;
- }
- }
- }
-
- if (matches) {
- // Find matching closing tag by tracking depth
- int contentStart = tagEnd + 1;
- int depth = 1;
- int pos = contentStart;
-
- while (pos < html.length() && depth > 0) {
- // Look for next opening or closing tag of same element
- int nextOpen = html.indexOf("<" + elementName, pos);
- int nextClose = html.indexOf("</" + elementName + ">", pos);
-
- // Validate that nextOpen is actually an opening tag
- if (nextOpen != -1 && (nextOpen < nextClose || nextClose == -1)) {
- if (nextOpen + elementName.length() + 1 < html.length()) {
- var nextChar = html.charAt(nextOpen + elementName.length() + 1);
- if (nextChar == ' ' || nextChar == '>' || nextChar == '/') {
- depth++;
- pos = nextOpen + elementName.length() + 1;
- continue;
- }
- }
- // Not a valid opening tag, skip it
- pos = nextOpen + 1;
- continue;
- }
-
- if (nextClose != -1) {
- depth--;
- if (depth == 0) {
- // Found matching close tag
- results.add(html.substring(contentStart, nextClose));
- break;
- }
- pos = nextClose + elementName.length() + 3;
- } else {
- // No more closing tags
- break;
- }
- }
- }
-
- searchPos = tagEnd + 1;
- }
-
- return results;
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/SerializedHttpEntity_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/SerializedHttpEntity_Test.java
deleted file mode 100644
index 22833b2567..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/SerializedHttpEntity_Test.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpEntities.*;
-import static org.apache.juneau.marshall.httppart.HttpPartSchema.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.marshall.httppart.*;
-import org.apache.juneau.marshall.json.*;
-import org.apache.juneau.marshall.msgpack.*;
-import org.apache.juneau.marshall.oapi.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.apache.juneau.rest.server.httppart.*;
-import org.apache.juneau.rest.server.servlet.*;
-import org.apache.juneau.testutils.pojos.*;
-import org.junit.jupiter.api.*;
-
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class SerializedHttpEntity_Test extends TestBase {
-
- @Rest
- public static class A extends BasicRestResource {
- @RestPost
- public String[] checkHeader(org.apache.juneau.rest.server.RestRequest req) {
- return req.getHeaders().getAll(req.getHeaderParam("Check").orElse(null)).stream().map(RequestHeader::getValue).toArray(String[]::new);
- }
- @RestPost
- public Reader checkBody(org.apache.juneau.rest.server.RestRequest req) throws IOException {
- return req.getReader();
- }
- }
-
- @Test void a01_basic() throws Exception {
- serializedEntity(ABean.get(),JsonSerializer.DEFAULT).assertString().is("{\"a\":1,\"b\":\"foo\"}");
- serializedEntity(ABean::get,JsonSerializer.DEFAULT).assertString().is("{\"a\":1,\"b\":\"foo\"}");
- serializedEntity(ABean.get(),null).assertString().is("{a:1,b:'foo'}");
- serializedEntity(null,JsonSerializer.DEFAULT).assertString().is("null");
- }
-
- @Test void a02_schema() throws Exception {
- serializedEntity(l("foo","bar"),OpenApiSerializer.DEFAULT).setSchema(T_ARRAY_PIPES).assertString().is("foo|bar");
- }
-
- @Test void a03_serializer_streaming() throws Exception {
- serializedEntity(ABean.get(),MsgPackSerializer.DEFAULT).assertBytes().asSpacedHex().is("82 A1 61 01 A1 62 A3 66 6F 6F");
- }
-
- @Test void a04_serializer_bad() {
- assertThrowsWithMessage(Exception.class, "Required value not provided.", ()->serializedEntity(null,OpenApiSerializer.DEFAULT).setSchema(schema().required().build()).asString());
- }
-
- @Test void a05_writeTo() throws Exception {
- var baos = new ByteArrayOutputStream();
- serializedEntity("foo", null).writeTo(baos);
- assertEquals("foo", toUtf8(baos.toByteArray()));
- }
-
- @Test void a06_isRepeatable() {
- assertTrue(serializedEntity(ABean.get(),null).isRepeatable());
- }
-
- @Test void a07_getContentLength() {
- assertEquals(-1L, serializedEntity(ABean.get(),null).getContentLength());
- }
-
- @Test void a08_getContent() {
- assertEquals("foo", toUtf8(serializedEntity("foo",null).getContent()));
- }
-
- @Test void a09_chunked() throws Exception {
- checkHeaderClient("Transfer-Encoding").post("/",serializedEntity(ABean.get(),null).setChunked()).run().assertContent("[\"chunked\"]");
- }
-
- @Test void a10_contentEncoding() throws Exception {
- checkHeaderClient("Content-Encoding").post("/",serializedEntity(ABean.get(),null).setContentEncoding("identity")).run().assertContent("[\"identity\"]");
- }
-
- @Test void a12_contentType() throws Exception {
- checkHeaderClient("Content-Type").post("/",serializedEntity(reader("foo"),null).setContentType("text/foo")).run().assertContent("[\"text/foo\"]");
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Utility methods
- //------------------------------------------------------------------------------------------------------------------
-
- private static HttpPartSchema.Builder schema() {
- return HttpPartSchema.create();
- }
-
- private static RestClient checkHeaderClient(String header) {
- return MockRestClient.create(A.class).rootUrl("http://localhost/checkHeader").json().header("Check",header).ignoreErrors().build();
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptCharset_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptCharset_Test.java
deleted file mode 100644
index 278eb10b65..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptCharset_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class AcceptCharset_Test extends TestBase {
-
- private static final String HEADER = "Accept-Charset";
- private static final String VALUE = "utf-8";
- private static final StringRanges PARSED = StringRanges.of("utf-8");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(acceptCharset(VALUE)).run().assertContent(VALUE);
- c.get().header(acceptCharset(VALUE)).run().assertContent(VALUE);
- c.get().header(acceptCharset(PARSED)).run().assertContent(VALUE);
- c.get().header(acceptCharset(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(acceptCharset((String)null)).run().assertContent().isEmpty();
- c.get().header(acceptCharset((Supplier<StringRanges>)null)).run().assertContent().isEmpty();
- c.get().header(acceptCharset(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(AcceptCharset.of((StringRanges)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptEncoding_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptEncoding_Test.java
deleted file mode 100644
index 584732e58a..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptEncoding_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class AcceptEncoding_Test extends TestBase {
-
- private static final String HEADER = "Accept-Encoding";
- private static final String VALUE = "foo";
- private static final StringRanges PARSED = StringRanges.of("foo");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(acceptEncoding(VALUE)).run().assertContent(VALUE);
- c.get().header(acceptEncoding(VALUE)).run().assertContent(VALUE);
- c.get().header(acceptEncoding(PARSED)).run().assertContent(VALUE);
- c.get().header(acceptEncoding(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(acceptEncoding((String)null)).run().assertContent("gzip,deflate");
- c.get().header(acceptEncoding((Supplier<StringRanges>)null)).run().assertContent("gzip,deflate");
- c.get().header(acceptEncoding(()->null)).run().assertContent("gzip,deflate");
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(AcceptEncoding.of((StringRanges)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptLanguage_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptLanguage_Test.java
deleted file mode 100644
index d823fd76cc..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptLanguage_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class AcceptLanguage_Test extends TestBase {
-
- private static final String HEADER = "Accept-Language";
- private static final String VALUE = "foo";
- private static final StringRanges PARSED = StringRanges.of("foo");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(acceptLanguage(VALUE)).run().assertContent(VALUE);
- c.get().header(acceptLanguage(VALUE)).run().assertContent(VALUE);
- c.get().header(acceptLanguage(PARSED)).run().assertContent(VALUE);
- c.get().header(acceptLanguage(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(acceptLanguage((String)null)).run().assertContent().isEmpty();
- c.get().header(acceptLanguage((Supplier<StringRanges>)null)).run().assertContent().isEmpty();
- c.get().header(acceptLanguage(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(AcceptLanguage.of((StringRanges)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptRanges_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptRanges_Test.java
deleted file mode 100644
index 3399354519..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/AcceptRanges_Test.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class AcceptRanges_Test extends TestBase {
-
- private static final String HEADER = "Accept-Ranges";
- private static final String VALUE = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(acceptRanges(VALUE)).run().assertContent(VALUE);
- c.get().header(acceptRanges(VALUE)).run().assertContent(VALUE);
- c.get().header(acceptRanges(()->VALUE)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(acceptRanges((String)null)).run().assertContent().isEmpty();
- c.get().header(acceptRanges((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(acceptRanges(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Accept_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Accept_Test.java
deleted file mode 100644
index 3f380ab097..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Accept_Test.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.*;
-import org.apache.juneau.commons.http.MediaType;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-/**
- * Tests: {@link Accept}
- */
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Accept_Test extends TestBase {
-
- private static final String HEADER = "Accept";
- private static final String VALUE = "foo";
- private static final MediaRanges PARSED = MediaRanges.of("foo");
-
- @Rest
- public static class A {
- @RestGet
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(accept(VALUE)).run().assertContent(VALUE);
- c.get().header(accept(VALUE)).run().assertContent(VALUE);
- c.get().header(accept(PARSED)).run().assertContent(VALUE);
- c.get().header(accept(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(accept((String)null)).run().assertContent().isEmpty();
- c.get().header(accept((Supplier<MediaRanges>)null)).run().assertContent().isEmpty();
- c.get().header(accept(()->null)).run().assertContent().isEmpty();
- }
-
- @Test void a02_asRanges() {
- assertNull(new Accept((String)null).asMediaRanges().orElse(null));
- assertEquals(-1, new Accept((String)null).match(l(MediaType.JSON)));
- assertNull(new Accept((String)null).getRange(0));
- assertString("Accept: application/json", new Accept(MediaRanges.of("application/json")));
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Age_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Age_Test.java
deleted file mode 100644
index 0e9371612d..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Age_Test.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Age_Test extends TestBase {
-
- private static final String HEADER = "Age";
- private static final String VALUE = "123";
- private static final Integer PARSED = 123;
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(age(VALUE)).run().assertContent(VALUE);
- c.get().header(age(VALUE)).run().assertContent(VALUE);
- c.get().header(age(PARSED)).run().assertContent(VALUE);
- c.get().header(age(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(age((String)null)).run().assertContent().isEmpty();
- c.get().header(age((Supplier<Integer>)null)).run().assertContent().isEmpty();
- c.get().header(age(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(Age.of((Integer)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Allow_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Allow_Test.java
deleted file mode 100644
index 327b8a3529..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Allow_Test.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Allow_Test extends TestBase {
-
- private static final String HEADER = "Allow";
- private static final String VALUE = "foo";
- private static final String[] PARSED = { "foo" };
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(allow(VALUE)).run().assertContent(VALUE);
- c.get().header(allow(VALUE)).run().assertContent(VALUE);
- c.get().header(allow(PARSED)).run().assertContent(VALUE);
- c.get().header(allow(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(allow((String)null)).run().assertContent().isEmpty();
- c.get().header(allow((Supplier<String[]>)null)).run().assertContent().isEmpty();
- c.get().header(allow(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(Allow.of((java.util.function.Supplier<String[]>)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Authorization_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Authorization_Test.java
deleted file mode 100644
index 1df460f015..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Authorization_Test.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Authorization_Test extends TestBase {
-
- private static final String HEADER = "Authorization";
- private static final String VALUE = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(authorization(VALUE)).run().assertContent(VALUE);
- c.get().header(authorization(VALUE)).run().assertContent(VALUE);
- c.get().header(authorization(()->VALUE)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(authorization((String)null)).run().assertContent().isEmpty();
- c.get().header(authorization((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(authorization(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicBooleanHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicBooleanHeader_Test.java
deleted file mode 100644
index a5c2d370d0..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicBooleanHeader_Test.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicBooleanHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "true";
- private static final Boolean PARSED = Boolean.TRUE;
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(booleanHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(booleanHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(booleanHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(booleanHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(booleanHeader(HEADER,(Supplier<Boolean>)null)).run().assertContent().isEmpty();
- c.get().header(booleanHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->booleanHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->booleanHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->booleanHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->booleanHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->booleanHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->booleanHeader(null, ()->PARSED));
- }
-
- @Test void a02_factoryNullReturns() {
- assertNull(BasicBooleanHeader.of("Foo", (Boolean)null));
- assertNull(BasicBooleanHeader.of("Foo", (String)null));
- assertNull(BasicBooleanHeader.of("Foo", (Supplier<Boolean>)null));
- }
-
- @Test void a03_methods() {
- var h = new BasicBooleanHeader("Foo", true);
- h.assertBoolean().isTrue();
- assertTrue(h.isTrue());
- assertEquals(Boolean.TRUE, h.orElse(false));
- assertEquals(Boolean.TRUE, h.toBoolean());
-
- var h2 = new BasicBooleanHeader("Foo", false);
- assertFalse(h2.isTrue());
- assertEquals(Boolean.FALSE, h2.orElse(true));
- assertEquals(Boolean.FALSE, h2.toBoolean());
-
- var h3 = new BasicBooleanHeader("Foo", (Boolean)null);
- assertNull(h3.toBoolean());
- assertEquals(Boolean.TRUE, h3.orElse(true));
- assertNull(h3.orElse((Boolean)null));
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicCsvHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicCsvHeader_Test.java
deleted file mode 100644
index 5cb0429d32..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicCsvHeader_Test.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicCsvHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "foo, bar";
- private static final String[] PARSED = { "foo", "bar" };
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(csvHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(csvHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(csvHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(csvHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(csvHeader(HEADER,(Supplier<String[]>)null)).run().assertContent().isEmpty();
- c.get().header(csvHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->csvHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->csvHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->csvHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->csvHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->csvHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->csvHeader(null, ()->PARSED));
- }
-
- @Test void a02_contains() {
- var x = new BasicCsvHeader("Foo", (String)null,"bar","baz");
- assertTrue(x.contains(null));
- assertTrue(x.containsIgnoreCase(null));
- assertTrue(x.contains("bar"));
- assertTrue(x.containsIgnoreCase("bar"));
- assertFalse(x.contains("qux"));
- assertFalse(x.containsIgnoreCase("qux"));
- assertFalse(x.contains("BAR"));
- assertTrue(x.containsIgnoreCase("BAR"));
-
- var x2 = csvHeader("Foo",()->null);
- assertFalse(x2.contains((String)null));
- assertFalse(x2.containsIgnoreCase(null));
- assertFalse(x2.contains("bar"));
- assertFalse(x2.containsIgnoreCase("bar"));
- }
-
- @Test void a03_assertList() {
- csvHeader("Foo", "bar").assertList().isContains("bar").assertList().isNotContains("baz");
- new BasicCsvHeader("Foo", (String)null).assertList().isNull();
- }
-
- @Test void a04_factoryNullReturns() {
- assertNull(BasicCsvHeader.of("Foo", (String)null));
- assertNull(BasicCsvHeader.of("Foo", (String[])null));
- assertNull(BasicCsvHeader.of("Foo", (Supplier<String[]>)null));
- }
-
- @Test void a05_additionalMethods() {
- var h = new BasicCsvHeader("Foo", "bar", "baz");
- assertTrue(h.asArray().isPresent());
- assertEquals(2, h.asArray().get().length);
- assertTrue(h.asList().isPresent());
- assertEquals(2, h.asList().get().size());
- assertEquals(2, h.orElse((String[])null).length);
- assertEquals(2, h.toArray().length);
- assertEquals(2, h.toList().size());
-
- var h2 = csvHeader("Foo", ()->null);
- assertFalse(h2.asArray().isPresent());
- assertFalse(h2.asList().isPresent());
- assertEquals(1, h2.orElse(new String[]{"other"}).length);
- assertNull(h2.toArray());
- assertNull(h2.toList());
-
- var h3 = csvHeader("Foo", ()->new String[]{"foo", "bar"});
- assertTrue(h3.contains("foo"));
- assertTrue(h3.containsIgnoreCase("FOO"));
- assertFalse(h3.contains("baz"));
- assertFalse(h3.containsIgnoreCase("BAZ"));
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicDateHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicDateHeader_Test.java
deleted file mode 100644
index 460bffed26..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicDateHeader_Test.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static java.time.format.DateTimeFormatter.*;
-import static java.time.temporal.ChronoUnit.*;
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.time.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicDateHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "Sat, 29 Oct 1994 19:43:31 GMT";
- private static final ZonedDateTime PARSED = ZonedDateTime.from(RFC_1123_DATE_TIME.parse(VALUE)).truncatedTo(SECONDS);
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(dateHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(dateHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(dateHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(dateHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(dateHeader(HEADER,(Supplier<ZonedDateTime>)null)).run().assertContent().isEmpty();
- c.get().header(dateHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->dateHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->dateHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->dateHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->dateHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->dateHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->dateHeader(null, ()->PARSED));
- }
-
- @Test void a02_asZonedDateTime() {
- assertString("1994-10-29T19:43:31Z", dateHeader(HEADER,VALUE).asZonedDateTime());
- }
-
- @Test void a04_assertZonedDateTime() {
- dateHeader(HEADER,VALUE).assertZonedDateTime().asString().is("1994-10-29T19:43:31Z");
- }
-
- @Test void a05_factoryNullReturns() {
- assertNull(BasicDateHeader.of("Foo", (String)null));
- assertNull(BasicDateHeader.of("Foo", (Supplier<ZonedDateTime>)null));
- assertNull(BasicDateHeader.of("Foo", (ZonedDateTime)null));
- }
-
- @Test void a06_orElseAndToZonedDateTime() {
- var h = dateHeader(HEADER, VALUE);
- assertNotNull(h.orElse((ZonedDateTime)null));
- assertNotNull(h.toZonedDateTime());
-
- // null supplier returns other
- var h2 = new BasicDateHeader(HEADER, (Supplier<ZonedDateTime>) () -> null);
- assertNull(h2.orElse((ZonedDateTime)null));
- assertNull(h2.toZonedDateTime());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicEntityTagHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicEntityTagHeader_Test.java
deleted file mode 100644
index 62115522be..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicEntityTagHeader_Test.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.http.header.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicEntityTagHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "\"foo\"";
- private static final EntityTag PARSED = EntityTag.of("\"foo\"");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(entityTagHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(entityTagHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(entityTagHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(entityTagHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(entityTagHeader(HEADER,(String)null)).run().assertContent().isEmpty();
- c.get().header(entityTagHeader(HEADER,(Supplier<EntityTag>)null)).run().assertContent().isEmpty();
- c.get().header(entityTagHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagHeader(null, ()->PARSED));
- }
-
- @Test void a02_asEntityTag() {
- var x = new BasicEntityTagHeader("Foo","W/\"foo\"").asEntityTag().get();
- assertString("W/\"foo\"", x);
- assertString("foo", x.getEntityValue());
- assertTrue(x.isWeak());
- assertFalse(x.isAny());
- }
-
- @Test void a03_factoryNullReturn() {
- assertNull(BasicEntityTagHeader.of("Foo", (org.apache.juneau.http.header.EntityTag)null));
- }
-
- @Test void a04_orElseAndToEntityTag() {
- var h = new BasicEntityTagHeader("Foo", "\"bar\"");
- assertNotNull(h.orElse((org.apache.juneau.http.header.EntityTag)null));
- assertNotNull(h.toEntityTag());
-
- // supplier returns null
- var h2 = new BasicEntityTagHeader("Foo", (java.util.function.Supplier<org.apache.juneau.http.header.EntityTag>) () -> null);
- assertNull(h2.orElse((org.apache.juneau.http.header.EntityTag)null));
- assertNull(h2.toEntityTag());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicEntityTagsHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicEntityTagsHeader_Test.java
deleted file mode 100644
index 3b5961e2be..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicEntityTagsHeader_Test.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.http.header.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicEntityTagsHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "\"foo\", \"bar\"";
- private static final EntityTags PARSED = EntityTags.of(EntityTag.of("\"foo\""), EntityTag.of("\"bar\""));
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi",aev=true) String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(entityTagsHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(entityTagsHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(entityTagsHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(entityTagsHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(entityTagsHeader(HEADER,(Supplier<EntityTags>)null)).run().assertContent().isEmpty();
- c.get().header(entityTagsHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagsHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagsHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagsHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagsHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagsHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->entityTagsHeader(null, ()->PARSED));
- }
-
- @Test void a02_factoryNullReturns() {
- assertNull(BasicEntityTagsHeader.of("Foo", (org.apache.juneau.http.header.EntityTags)null));
- assertNull(BasicEntityTagsHeader.of("Foo", (String)null));
- }
-
- @Test void a03_orElseAndToEntityTags() {
- var h = entityTagsHeader("Foo", "\"bar\"");
- assertNotNull(h.orElse((org.apache.juneau.http.header.EntityTags)null));
- assertNotNull(h.toEntityTags());
-
- // supplier returns null
- var h2 = new BasicEntityTagsHeader("Foo", (java.util.function.Supplier<org.apache.juneau.http.header.EntityTags>) () -> null);
- assertNull(h2.orElse((org.apache.juneau.http.header.EntityTags)null));
- assertNull(h2.toEntityTags());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicIntegerHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicIntegerHeader_Test.java
deleted file mode 100644
index 2afec4efc5..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicIntegerHeader_Test.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicIntegerHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "123";
- private static final Integer PARSED = 123;
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(integerHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(integerHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(integerHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(integerHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(integerHeader(HEADER,(Supplier<Integer>)null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(RuntimeException.class, "Value 'foo' could not be parsed as an integer.", ()->integerHeader(HEADER,"foo"));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->integerHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->integerHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->integerHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->integerHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->integerHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->integerHeader(null, ()->PARSED));
- }
-
- @Test void a02_assertInteger() {
- assertEquals(1, integerHeader(HEADER,1).asInteger().get());
- integerHeader(HEADER,1).assertInteger().is(1);
- }
-
- @Test void a03_factoryNullReturns() {
- assertNull(BasicIntegerHeader.of("Foo", (Integer)null));
- assertNull(BasicIntegerHeader.of("Foo", (String)null));
- assertNull(BasicIntegerHeader.of("Foo", (Supplier<Integer>)null));
- }
-
- @Test void a04_methods() {
- var h = new BasicIntegerHeader("Foo", 42);
- assertEquals(Integer.valueOf(42), h.orElse(0));
- assertEquals(Integer.valueOf(42), h.toInteger());
-
- var h2 = new BasicIntegerHeader("Foo", (Integer)null);
- assertNull(h2.toInteger());
- assertEquals(Integer.valueOf(99), h2.orElse(99));
- }
-
- @Test void a05_wireConstructor_nullValue() {
- var h = new BasicIntegerHeader("Foo", (String)null);
- assertNull(h.toInteger());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicLongHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicLongHeader_Test.java
deleted file mode 100644
index 4e0cfa02bc..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicLongHeader_Test.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicLongHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "123";
- private static final Long PARSED = 123L;
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(longHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(longHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(longHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(longHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(longHeader(HEADER,(Supplier<Long>)null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(RuntimeException.class, "Value 'foo' could not be parsed as a long.", ()->longHeader(HEADER,"foo"));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->longHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->longHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->longHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->longHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->longHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->longHeader(null, ()->PARSED));
- }
-
- @Test void a02_assertLong() {
- longHeader(HEADER,1L).assertLong().is(1L);
- }
-
- @Test void a03_factoryNullReturns() {
- assertNull(BasicLongHeader.of("Foo", (Long)null));
- assertNull(BasicLongHeader.of("Foo", (String)null));
- assertNull(BasicLongHeader.of("Foo", (Supplier<Long>)null));
- }
-
- @Test void a04_methods() {
- var h = new BasicLongHeader("Foo", 42L);
- assertEquals(Long.valueOf(42L), h.orElse(0L));
- assertEquals(Long.valueOf(42L), h.toLong());
-
- var h2 = new BasicLongHeader("Foo", (Long)null);
- assertNull(h2.toLong());
- assertEquals(Long.valueOf(99L), h2.orElse(99L));
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicMediaRangesHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicMediaRangesHeader_Test.java
deleted file mode 100644
index a5dd93e14a..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicMediaRangesHeader_Test.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.*;
-import org.apache.juneau.commons.http.MediaType;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicMediaRangesHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "foo/bar;x=1";
- private static final MediaRanges PARSED = MediaRanges.of("foo/bar;x=1");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(mediaRangesHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(mediaRangesHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(mediaRangesHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(mediaRangesHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(mediaRangesHeader(HEADER,(Supplier<MediaRanges>)null)).run().assertContent().isEmpty();
- c.get().header(mediaRangesHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaRangesHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaRangesHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaRangesHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaRangesHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaRangesHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaRangesHeader(null, ()->PARSED));
- }
-
- @Test void a02_match() {
- assertEquals(0, accept("text/foo").match(l(MediaType.of("text/foo"))));
- assertEquals(-1, accept("text/foo").match(l(MediaType.of("text/bar"))));
- assertEquals(-1, new Accept((String)null).match(l(MediaType.of("text/bar"))));
- assertEquals(-1, accept("text/foo").match(l(MediaType.of(null))));
- assertEquals(-1, accept("text/foo").match(null));
- }
-
- @Test void a03_getRange() {
- assertEquals("text/foo", s(accept("text/foo").getRange(0)));
- assertNull(accept("text/foo").getRange(1));
- assertNull(accept("text/foo").getRange(-1));
- assertNull(new Accept((String)null).getRange(0));
- }
-
- @Test void a04_hasSubtypePart() {
- assertTrue(accept("text/foo").hasSubtypePart("foo"));
- assertFalse(accept("text/foo").hasSubtypePart("bar"));
- assertFalse(accept("text/foo").hasSubtypePart(null));
- assertFalse(new Accept((String)null).hasSubtypePart("foo"));
- }
-
- @Test void a05_getRanges() {
- assertList(accept("text/foo,text/bar").toMediaRanges().toList(), "text/foo" ,"text/bar");
- assertNull(new Accept((String)null).toMediaRanges());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicMediaTypeHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicMediaTypeHeader_Test.java
deleted file mode 100644
index 25e7d45c82..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicMediaTypeHeader_Test.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.MediaType;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicMediaTypeHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "foo/bar";
- private static final MediaType PARSED = MediaType.of("foo/bar");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(mediaTypeHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(mediaTypeHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(mediaTypeHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(mediaTypeHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(mediaTypeHeader(HEADER,(Supplier<MediaType>)null)).run().assertContent().isEmpty();
- c.get().header(mediaTypeHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaTypeHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaTypeHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaTypeHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaTypeHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaTypeHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->mediaTypeHeader(null, ()->PARSED));
- }
-
- @Test void a02_getType() {
- assertEquals("text", contentType("text/foo").getType());
- assertEquals("", new ContentType((String)null).getType());
- }
-
- @Test void a03_getSubType() {
- assertEquals("foo", contentType("text/foo").getSubType());
- assertEquals("*", new ContentType((String)null).getSubType());
- }
-
- @Test void a04_hasSubType() {
- assertTrue(contentType("text/foo+bar").hasSubType("bar"));
- assertFalse(contentType("text/foo+bar").hasSubType("baz"));
- assertFalse(contentType("text/foo+bar").hasSubType(null));
- assertFalse(new ContentType((String)null).hasSubType("bar"));
- }
-
- @Test void a05_getSubTypes() {
- assertList(contentType("text/foo+bar").getSubTypes(), "foo", "bar");
- assertList(new ContentType((String)null).getSubTypes(), "*");
- }
-
- @Test void a06_isMeta() {
- assertFalse(contentType("text/foo+bar").isMetaSubtype());
- assertTrue(contentType("text/*").isMetaSubtype());
- assertTrue(new ContentType((String)null).isMetaSubtype());
- }
-
- @Test void a07_match() {
- assertEquals(100000, contentType("text/foo").match(MediaType.of("text/foo"),true));
- assertEquals(0, new ContentType((String)null).match(MediaType.of("text/foo"),true));
- }
-
- @Test void a08_getParameters() {
- assertList(contentType("text/foo;x=1;y=2").getParameters(), "x=1", "y=2");
- assertEmpty(new ContentType((String)null).getParameters());
- }
-
- @Test void a09_getParameter() {
- assertEquals("1", contentType("text/foo;x=1;y=2").getParameter("x"));
- assertNull(contentType("text/foo;x=1;y=2").getParameter("z"));
- assertNull(contentType("text/foo;x=1;y=2").getParameter(null));
- assertNull(new ContentType((String)null).getParameter("x"));
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicStringHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicStringHeader_Test.java
deleted file mode 100644
index 2be98152ca..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicStringHeader_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicStringHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "bar";
- private static final String PARSED = "bar";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(stringHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(stringHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(stringHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(stringHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(stringHeader(HEADER,(Supplier<String>)null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringHeader(null, ()->PARSED));
- }
-
- @Test void a02_assertString() {
- stringHeader(HEADER,"1").assertString().is("1");
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicStringRangesHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicStringRangesHeader_Test.java
deleted file mode 100644
index 0f87e435e6..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicStringRangesHeader_Test.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicStringRangesHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "foo, bar";
- private static final StringRanges PARSED = StringRanges.of("foo, bar");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(stringRangesHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(stringRangesHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(stringRangesHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(stringRangesHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(stringRangesHeader(HEADER,(Supplier<StringRanges>)null)).run().assertContent().isEmpty();
- c.get().header(stringRangesHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringRangesHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringRangesHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringRangesHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringRangesHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringRangesHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->stringRangesHeader(null, ()->PARSED));
- }
-
- @Test void a02_getRange() {
- assertString("foo", stringRangesHeader(HEADER,PARSED).getRange(0));
- }
-
- @Test void a03_getRanges() {
- assertList(stringRangesHeader(HEADER,PARSED).toStringRanges().toList(), "foo", "bar");
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicUriHeader_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicUriHeader_Test.java
deleted file mode 100644
index 02d5f4d1fc..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/BasicUriHeader_Test.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class BasicUriHeader_Test extends TestBase {
-
- private static final String HEADER = "Foo";
- private static final String VALUE = "foo://bar";
- private static final URI PARSED = URI.create("foo://bar");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, '|'));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(uriHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(uriHeader(HEADER,VALUE)).run().assertContent(VALUE);
- c.get().header(uriHeader(HEADER,PARSED)).run().assertContent(VALUE);
- c.get().header(uriHeader(HEADER,()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(uriHeader(HEADER,(Supplier<URI>)null)).run().assertContent().isEmpty();
- c.get().header(uriHeader(HEADER,()->null)).run().assertContent().isEmpty();
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->uriHeader("", VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->uriHeader(null, VALUE));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->uriHeader("", PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->uriHeader(null, PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->uriHeader("", ()->PARSED));
- assertThrowsWithMessage(IllegalArgumentException.class, "Name cannot be empty on header.", ()->uriHeader(null, ()->PARSED));
- }
-
- @Test void a02_asUri() {
- assertString("http://foo", uriHeader(HEADER,"http://foo").asUri().get());
- assertEmpty(new BasicUriHeader(HEADER, (URI)null).asUri());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/CacheControl_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/CacheControl_Test.java
deleted file mode 100644
index ea7b2c6016..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/CacheControl_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class CacheControl_Test extends TestBase {
-
- private static final String HEADER = "Cache-Control";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(cacheControl(VALUE)).run().assertContent(VALUE);
- c.get().header(cacheControl(VALUE)).run().assertContent(VALUE);
- c.get().header(cacheControl(PARSED)).run().assertContent(VALUE);
- c.get().header(cacheControl(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(cacheControl((String)null)).run().assertContent().isEmpty();
- c.get().header(cacheControl((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(cacheControl(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ClientVersion_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ClientVersion_Test.java
deleted file mode 100644
index 00bdb6e038..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ClientVersion_Test.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.lang.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ClientVersion_Test extends TestBase {
-
- private static final String HEADER = "Client-Version";
- private static final String VALUE = "1.2.3";
- private static final Version PARSED = Version.of("1.2.3");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(clientVersion(VALUE)).run().assertContent(VALUE);
- c.get().header(clientVersion(VALUE)).run().assertContent(VALUE);
- c.get().header(clientVersion(PARSED)).run().assertContent(VALUE);
- c.get().header(clientVersion(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(clientVersion((String)null)).run().assertContent().isEmpty();
- c.get().header(clientVersion((Supplier<Version>)null)).run().assertContent().isEmpty();
- c.get().header(clientVersion(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Connection_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Connection_Test.java
deleted file mode 100644
index e4ad969bd2..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Connection_Test.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Connection_Test extends TestBase {
-
- private static final String HEADER = "Connection";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(connection(VALUE)).run().assertContent(VALUE);
- c.get().header(connection(VALUE)).run().assertContent(VALUE);
- c.get().header(connection(PARSED)).run().assertContent(VALUE);
- c.get().header(connection(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(connection((String)null)).run().assertContent("Keep-Alive");
- c.get().header(connection((Supplier<String>)null)).run().assertContent("Keep-Alive");
- c.get().header(connection(()->null)).run().assertContent("Keep-Alive");
- }
-
- @Test void a02_other() {
- assertTrue(connection("Keep-Alive").isKeepAlive());
- assertTrue(connection("keep-alive").isKeepAlive());
- assertFalse(connection("foo").isKeepAlive());
- assertTrue(connection("Close").isClose());
- assertTrue(connection("close").isClose());
- assertFalse(connection("foo").isClose());
- assertTrue(connection("Upgrade").isUpgrade());
- assertTrue(connection("upgrade").isUpgrade());
- assertFalse(connection("foo").isUpgrade());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentDisposition_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentDisposition_Test.java
deleted file mode 100644
index 99e34bed48..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentDisposition_Test.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ContentDisposition_Test extends TestBase {
-
- private static final String HEADER = "Content-Disposition";
- private static final String VALUE = "foo";
- private static final StringRanges PARSED = StringRanges.of("foo");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(contentDisposition(VALUE)).run().assertContent(VALUE);
- c.get().header(contentDisposition(VALUE)).run().assertContent(VALUE);
- c.get().header(contentDisposition(PARSED)).run().assertContent(VALUE);
- c.get().header(contentDisposition(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(contentDisposition((String)null)).run().assertContent().isEmpty();
- c.get().header(contentDisposition((Supplier<StringRanges>)null)).run().assertContent().isEmpty();
- c.get().header(contentDisposition(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // ContentDisposition.attachment / contentDispositionAttachment
- //------------------------------------------------------------------------------------------------------------------
-
- @Test
- void b01_attachment_simpleFilename() {
- assertEquals("attachment; filename=\"example.pdf\"", ContentDisposition.attachment("example.pdf").getValue());
- assertEquals("attachment; filename=\"example.pdf\"", contentDispositionAttachment("example.pdf").getValue());
- }
-
- @Test
- void b02_attachment_escapesQuotesAndBackslashes() {
- assertEquals("attachment; filename=\"a\\\\b\\\"c.pdf\"", ContentDisposition.attachment("a\\b\"c.pdf").getValue());
- }
-
- @Test
- void b03_attachment_rejectsNullBlankAndNewlines() {
- assertThrowsWithMessage(IllegalArgumentException.class, "null or blank", () -> ContentDisposition.attachment(null));
- assertThrowsWithMessage(IllegalArgumentException.class, "null or blank", () -> ContentDisposition.attachment(""));
- assertThrowsWithMessage(IllegalArgumentException.class, "null or blank", () -> ContentDisposition.attachment(" "));
- assertThrowsWithMessage(IllegalArgumentException.class, "CR or LF", () -> ContentDisposition.attachment("a\nb"));
- assertThrowsWithMessage(IllegalArgumentException.class, "CR or LF", () -> ContentDisposition.attachment("a\rb"));
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentEncoding_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentEncoding_Test.java
deleted file mode 100644
index b83e740d27..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentEncoding_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ContentEncoding_Test extends TestBase {
-
- private static final String HEADER = "Content-Encoding";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(contentEncoding(VALUE)).run().assertContent(VALUE);
- c.get().header(contentEncoding(VALUE)).run().assertContent(VALUE);
- c.get().header(contentEncoding(PARSED)).run().assertContent(VALUE);
- c.get().header(contentEncoding(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(contentEncoding((String)null)).run().assertContent().isEmpty();
- c.get().header(contentEncoding((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(contentEncoding(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLanguage_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLanguage_Test.java
deleted file mode 100644
index 0c77e44954..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLanguage_Test.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ContentLanguage_Test extends TestBase {
-
- private static final String HEADER = "Content-Language";
- private static final String VALUE = "foo";
- private static final String[] PARSED = { "foo" };
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(contentLanguage(VALUE)).run().assertContent(VALUE);
- c.get().header(contentLanguage(VALUE)).run().assertContent(VALUE);
- c.get().header(contentLanguage(PARSED)).run().assertContent(VALUE);
- c.get().header(contentLanguage(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(contentLanguage((String)null)).run().assertContent().isEmpty();
- c.get().header(contentLanguage((Supplier<String[]>)null)).run().assertContent().isEmpty();
- c.get().header(contentLanguage(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(ContentLanguage.of((Supplier<String[]>)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLength_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLength_Test.java
deleted file mode 100644
index bf03b68ebb..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLength_Test.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ContentLength_Test extends TestBase {
-
- private static final String HEADER = "Content-Length";
- private static final String VALUE = "123";
- private static final Long PARSED = 123L;
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(contentLength(VALUE)).run().assertContent(VALUE);
- c.get().header(contentLength(VALUE)).run().assertContent(VALUE);
- c.get().header(contentLength(PARSED)).run().assertContent(VALUE);
- c.get().header(contentLength(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(contentLength((String)null)).run().assertContent().isEmpty();
- c.get().header(contentLength((Supplier<Long>)null)).run().assertContent().isEmpty();
- c.get().header(contentLength(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(ContentLength.of((Long)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLocation_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLocation_Test.java
deleted file mode 100644
index d572c1f458..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentLocation_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ContentLocation_Test extends TestBase {
-
- private static final String HEADER = "Content-Location";
- private static final String VALUE = "foo://bar";
- private static final URI PARSED = URI.create("foo://bar");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(contentLocation(VALUE)).run().assertContent(VALUE);
- c.get().header(contentLocation(VALUE)).run().assertContent(VALUE);
- c.get().header(contentLocation(PARSED)).run().assertContent(VALUE);
- c.get().header(contentLocation(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(contentLocation((String)null)).run().assertContent().isEmpty();
- c.get().header(contentLocation((Supplier<URI>)null)).run().assertContent().isEmpty();
- c.get().header(contentLocation(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(ContentLocation.of((java.net.URI)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentRange_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentRange_Test.java
deleted file mode 100644
index 55f0e56c6e..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentRange_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ContentRange_Test extends TestBase {
-
- private static final String HEADER = "Content-Range";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(contentRange(VALUE)).run().assertContent(VALUE);
- c.get().header(contentRange(VALUE)).run().assertContent(VALUE);
- c.get().header(contentRange(PARSED)).run().assertContent(VALUE);
- c.get().header(contentRange(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(contentRange((String)null)).run().assertContent().isEmpty();
- c.get().header(contentRange((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(contentRange(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentType_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentType_Test.java
deleted file mode 100644
index fb12cdc88d..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ContentType_Test.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.commons.http.MediaType;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ContentType_Test extends TestBase {
-
- private static final String HEADER = "Content-Type";
- private static final String VALUE = "foo/bar";
- private static final MediaType PARSED = MediaType.of("foo/bar");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(contentType(VALUE)).run().assertContent(VALUE);
- c.get().header(contentType(VALUE)).run().assertContent(VALUE);
- c.get().header(contentType(PARSED)).run().assertContent(VALUE);
- c.get().header(contentType(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(contentType((String)null)).run().assertContent().isEmpty();
- c.get().header(contentType((MediaType)null)).run().assertContent().isEmpty();
- c.get().header(contentType((Supplier<MediaType>)null)).run().assertContent().isEmpty();
- c.get().header(contentType(()->null)).run().assertContent().isEmpty();
- }
-
- @Test void a02_asMediaType() {
- assertString("application/json", contentType(()->MediaType.JSON).asMediaType());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Date_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Date_Test.java
deleted file mode 100644
index 0c30bd1ddd..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Date_Test.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static java.time.format.DateTimeFormatter.*;
-import static java.time.temporal.ChronoUnit.*;
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.time.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Date_Test extends TestBase {
-
- private static final String HEADER = "Date";
- private static final String VALUE = "Sat, 29 Oct 1994 19:43:31 GMT";
- private static final ZonedDateTime PARSED = ZonedDateTime.from(RFC_1123_DATE_TIME.parse(VALUE)).truncatedTo(SECONDS);
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(date(VALUE)).run().assertContent(VALUE);
- c.get().header(date(VALUE)).run().assertContent(VALUE);
- c.get().header(date(PARSED)).run().assertContent(VALUE);
- c.get().header(date(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(date((String)null)).run().assertContent().isEmpty();
- c.get().header(date((Supplier<ZonedDateTime>)null)).run().assertContent().isEmpty();
- c.get().header(date(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(Date.of((java.time.ZonedDateTime)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Debug_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Debug_Test.java
deleted file mode 100644
index fd87d57b56..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Debug_Test.java
+++ /dev/null
@@ -1,79 +0,0 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Debug_Test extends TestBase {
-
- private static final String HEADER = "Debug";
- private static final String VALUE = "true";
- private static final Boolean PARSED = Boolean.TRUE;
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- c.get().header(debug(VALUE)).run().assertContent(VALUE);
- c.get().header(debug(PARSED)).run().assertContent(VALUE);
- c.get().header(debug(()->PARSED)).run().assertContent(VALUE);
-
- c.get().header(debug((String)null)).run().assertContent().isEmpty();
- c.get().header(debug((Supplier<Boolean>)null)).run().assertContent().isEmpty();
- c.get().header(debug(()->null)).run().assertContent().isEmpty();
- }
-
- @Test void a02_factoryNullReturns() {
- assertNull(Debug.of((Boolean)null));
- assertNull(Debug.of((String)null));
- assertNull(Debug.of((Supplier<Boolean>)null));
- }
-
- @Test void a03_constants() {
- assertNotNull(Debug.TRUE);
- assertNotNull(Debug.FALSE);
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ETag_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ETag_Test.java
deleted file mode 100644
index be4459fd1d..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ETag_Test.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.http.header.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ETag_Test extends TestBase {
-
- private static final String HEADER = "ETag";
- private static final String VALUE = "\"foo\"";
- private static final EntityTag PARSED = EntityTag.of("\"foo\"");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(eTag(VALUE)).run().assertContent(VALUE);
- c.get().header(eTag(VALUE)).run().assertContent(VALUE);
- c.get().header(eTag(PARSED)).run().assertContent(VALUE);
- c.get().header(eTag(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(eTag((String)null)).run().assertContent().isEmpty();
- c.get().header(eTag((Supplier<EntityTag>)null)).run().assertContent().isEmpty();
- c.get().header(eTag(()->null)).run().assertContent().isEmpty();
- }
-
- @Test void a0_asEntityTag() {
- var x = new ETag("W/\"foo\"").asEntityTag().get();
- assertString("W/\"foo\"", x);
- assertEquals("foo", x.getEntityValue());
- assertTrue(x.isWeak());
- assertFalse(x.isAny());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(ETag.of((org.apache.juneau.http.header.EntityTag)null));
- }
-}
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Expect_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Expect_Test.java
deleted file mode 100644
index f656d6117b..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Expect_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Expect_Test extends TestBase {
-
- private static final String HEADER = "Expect";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(expect(VALUE)).run().assertContent(VALUE);
- c.get().header(expect(VALUE)).run().assertContent(VALUE);
- c.get().header(expect(PARSED)).run().assertContent(VALUE);
- c.get().header(expect(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(expect((String)null)).run().assertContent().isEmpty();
- c.get().header(expect((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(expect(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Expires_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Expires_Test.java
deleted file mode 100644
index fab1ba6fc2..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Expires_Test.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static java.time.format.DateTimeFormatter.*;
-import static java.time.temporal.ChronoUnit.*;
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.time.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Expires_Test extends TestBase {
-
- private static final String HEADER = "Expires";
- private static final String VALUE = "Sat, 29 Oct 1994 19:43:31 GMT";
- private static final ZonedDateTime PARSED = ZonedDateTime.from(RFC_1123_DATE_TIME.parse(VALUE)).truncatedTo(SECONDS);
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(expires(VALUE)).run().assertContent(VALUE);
- c.get().header(expires(VALUE)).run().assertContent(VALUE);
- c.get().header(expires(PARSED)).run().assertContent(VALUE);
- c.get().header(expires(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(expires((String)null)).run().assertContent("");
- c.get().header(expires((Supplier<ZonedDateTime>)null)).run().assertContent("");
- c.get().header(expires(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(Expires.of((java.time.ZonedDateTime)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Forwarded_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Forwarded_Test.java
deleted file mode 100644
index 8eeb051a88..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Forwarded_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Forwarded_Test extends TestBase {
-
- private static final String HEADER = "Forwarded";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(forwarded(VALUE)).run().assertContent(VALUE);
- c.get().header(forwarded(VALUE)).run().assertContent(VALUE);
- c.get().header(forwarded(PARSED)).run().assertContent(VALUE);
- c.get().header(forwarded(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(forwarded((String)null)).run().assertContent().isEmpty();
- c.get().header(forwarded((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(forwarded(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/From_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/From_Test.java
deleted file mode 100644
index 3806401250..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/From_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class From_Test extends TestBase {
-
- private static final String HEADER = "From";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(from(VALUE)).run().assertContent(VALUE);
- c.get().header(from(VALUE)).run().assertContent(VALUE);
- c.get().header(from(PARSED)).run().assertContent(VALUE);
- c.get().header(from(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(from((String)null)).run().assertContent().isEmpty();
- c.get().header(from((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(from(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Host_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Host_Test.java
deleted file mode 100644
index abcde81569..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Host_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Host_Test extends TestBase {
-
- private static final String HEADER = "Host";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(host(VALUE)).run().assertContent(VALUE);
- c.get().header(host(VALUE)).run().assertContent(VALUE);
- c.get().header(host(PARSED)).run().assertContent(VALUE);
- c.get().header(host(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(host((String)null)).run().assertContent("localhost");
- c.get().header(host((Supplier<String>)null)).run().assertContent("localhost");
- c.get().header(host(()->null)).run().assertContent("localhost");
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfMatch_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfMatch_Test.java
deleted file mode 100644
index 97b671373f..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfMatch_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.http.header.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class IfMatch_Test extends TestBase {
-
- private static final String HEADER = "If-Match";
- private static final String VALUE = "\"foo\", \"bar\"";
- private static final EntityTags PARSED = EntityTags.of(EntityTag.of("\"foo\""), EntityTag.of("\"bar\""));
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi",aev=true) String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(ifMatch(VALUE)).run().assertContent(VALUE);
- c.get().header(ifMatch(VALUE)).run().assertContent(VALUE);
- c.get().header(ifMatch(PARSED)).run().assertContent(VALUE);
- c.get().header(ifMatch(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(ifMatch((String)null)).run().assertContent().isEmpty();
- c.get().header(ifMatch((Supplier<EntityTags>)null)).run().assertContent().isEmpty();
- c.get().header(ifMatch(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(IfMatch.of((org.apache.juneau.http.header.EntityTags)null));
- }
-}
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfModifiedSince_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfModifiedSince_Test.java
deleted file mode 100644
index 9e95914fbf..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfModifiedSince_Test.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static java.time.format.DateTimeFormatter.*;
-import static java.time.temporal.ChronoUnit.*;
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.time.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class IfModifiedSince_Test extends TestBase {
-
- private static final String HEADER = "If-Modified-Since";
- private static final String VALUE = "Sat, 29 Oct 1994 19:43:31 GMT";
- private static final ZonedDateTime PARSED = ZonedDateTime.from(RFC_1123_DATE_TIME.parse(VALUE)).truncatedTo(SECONDS);
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(ifModifiedSince(VALUE)).run().assertContent(VALUE);
- c.get().header(ifModifiedSince(VALUE)).run().assertContent(VALUE);
- c.get().header(ifModifiedSince(PARSED)).run().assertContent(VALUE);
- c.get().header(ifModifiedSince(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(ifModifiedSince((String)null)).run().assertContent("");
- c.get().header(ifModifiedSince((Supplier<ZonedDateTime>)null)).run().assertContent("");
- c.get().header(ifModifiedSince(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(IfModifiedSince.of((java.time.ZonedDateTime)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfNoneMatch_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfNoneMatch_Test.java
deleted file mode 100644
index 47431af8e6..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfNoneMatch_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.http.header.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class IfNoneMatch_Test extends TestBase {
-
- private static final String HEADER = "If-None-Match";
- private static final String VALUE = "\"foo\", \"bar\"";
- private static final EntityTags PARSED = EntityTags.of(EntityTag.of("\"foo\""), EntityTag.of("\"bar\""));
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi",aev=true) String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(ifNoneMatch(VALUE)).run().assertContent(VALUE);
- c.get().header(ifNoneMatch(VALUE)).run().assertContent(VALUE);
- c.get().header(ifNoneMatch(PARSED)).run().assertContent(VALUE);
- c.get().header(ifNoneMatch(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(ifNoneMatch((String)null)).run().assertContent().isEmpty();
- c.get().header(ifNoneMatch((Supplier<EntityTags>)null)).run().assertContent().isEmpty();
- c.get().header(ifNoneMatch(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(IfNoneMatch.of((org.apache.juneau.http.header.EntityTags)null));
- }
-}
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfRange_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfRange_Test.java
deleted file mode 100644
index 2d857040c7..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfRange_Test.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static java.time.format.DateTimeFormatter.*;
-import static java.time.temporal.ChronoUnit.*;
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.apache.juneau.junit.bct.BctAssertions.*;
-
-import java.io.*;
-import java.time.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.http.header.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class IfRange_Test extends TestBase {
-
- private static final String HEADER = "If-Range";
- private static final String VALUE1 = "\"foo\"";
- private static final String VALUE2 = "W/\"foo\"";
- private static final String VALUE3 = "Sat, 29 Oct 1994 19:43:31 GMT";
- private static final EntityTag PARSED1 = EntityTag.of(VALUE1);
- private static final EntityTag PARSED2 = EntityTag.of(VALUE2);
- private static final ZonedDateTime PARSED3 = ZonedDateTime.from(RFC_1123_DATE_TIME.parse(VALUE3)).truncatedTo(SECONDS);
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(ifRange(VALUE1)).run().assertContent(VALUE1);
- c.get().header(ifRange(VALUE1)).run().assertContent(VALUE1);
- c.get().header(ifRange(PARSED1)).run().assertContent(VALUE1);
- c.get().header(ifRange(()->PARSED1)).run().assertContent(VALUE1);
-
- c.get().header(ifRange(VALUE2)).run().assertContent(VALUE2);
- c.get().header(ifRange(VALUE2)).run().assertContent(VALUE2);
- c.get().header(ifRange(PARSED2)).run().assertContent(VALUE2);
- c.get().header(ifRange(()->PARSED2)).run().assertContent(VALUE2);
-
- c.get().header(ifRange(VALUE3)).run().assertContent(VALUE3);
- c.get().header(ifRange(VALUE3)).run().assertContent(VALUE3);
- c.get().header(ifRange(PARSED3)).run().assertContent(VALUE3);
- c.get().header(ifRange(()->PARSED3)).run().assertContent(VALUE3);
-
- // Invalid usage.
- c.get().header(ifRange((String)null)).run().assertContent().isEmpty();
- c.get().header(ifRange((Supplier<ZonedDateTime>)null)).run().assertContent().isEmpty();
- c.get().header(ifRange(()->null)).run().assertContent().isEmpty();
- }
-
- @Test void a02_asEntityTag() {
- var x = ifRange(VALUE1).asEntityTag().get();
- assertString("\"foo\"", x);
- assertEmpty(ifRange(()->null).asEntityTag());
- assertEmpty(ifRange(()->PARSED3).asEntityTag());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfUnmodifiedSince_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfUnmodifiedSince_Test.java
deleted file mode 100644
index 201fca543f..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/IfUnmodifiedSince_Test.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static java.time.format.DateTimeFormatter.*;
-import static java.time.temporal.ChronoUnit.*;
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.time.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class IfUnmodifiedSince_Test extends TestBase {
-
- private static final String HEADER = "If-Unmodified-Since";
- private static final String VALUE = "Sat, 29 Oct 1994 19:43:31 GMT";
- private static final ZonedDateTime PARSED = ZonedDateTime.from(RFC_1123_DATE_TIME.parse(VALUE)).truncatedTo(SECONDS);
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(ifUnmodifiedSince(VALUE)).run().assertContent(VALUE);
- c.get().header(ifUnmodifiedSince(VALUE)).run().assertContent(VALUE);
- c.get().header(ifUnmodifiedSince(PARSED)).run().assertContent(VALUE);
- c.get().header(ifUnmodifiedSince(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(ifUnmodifiedSince((String)null)).run().assertContent().isEmpty();
- c.get().header(ifUnmodifiedSince((Supplier<ZonedDateTime>)null)).run().assertContent().isEmpty();
- c.get().header(ifUnmodifiedSince(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(IfUnmodifiedSince.of((java.time.ZonedDateTime)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/LastModified_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/LastModified_Test.java
deleted file mode 100644
index 9430fc4e86..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/LastModified_Test.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static java.time.format.DateTimeFormatter.*;
-import static java.time.temporal.ChronoUnit.*;
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.time.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class LastModified_Test extends TestBase {
-
- private static final String HEADER = "Last-Modified";
- private static final String VALUE = "Sat, 29 Oct 1994 19:43:31 GMT";
- private static final ZonedDateTime PARSED = ZonedDateTime.from(RFC_1123_DATE_TIME.parse(VALUE)).truncatedTo(SECONDS);
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(lastModified(VALUE)).run().assertContent(VALUE);
- c.get().header(lastModified(VALUE)).run().assertContent(VALUE);
- c.get().header(lastModified(PARSED)).run().assertContent(VALUE);
- c.get().header(lastModified(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(lastModified((String)null)).run().assertContent().isEmpty();
- c.get().header(lastModified((Supplier<ZonedDateTime>)null)).run().assertContent().isEmpty();
- c.get().header(lastModified(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(LastModified.of((java.time.ZonedDateTime)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Location_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Location_Test.java
deleted file mode 100644
index acb0c1d646..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Location_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Location_Test extends TestBase {
-
- private static final String HEADER = "Location";
- private static final String VALUE = "foo://bar";
- private static final URI PARSED = URI.create("foo://bar");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(location(VALUE)).run().assertContent(VALUE);
- c.get().header(location(VALUE)).run().assertContent(VALUE);
- c.get().header(location(PARSED)).run().assertContent(VALUE);
- c.get().header(location(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(location((String)null)).run().assertContent().isEmpty();
- c.get().header(location((Supplier<URI>)null)).run().assertContent().isEmpty();
- c.get().header(location(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(Location.of((java.net.URI)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/MaxForwards_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/MaxForwards_Test.java
deleted file mode 100644
index b0ec9966ee..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/MaxForwards_Test.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class MaxForwards_Test extends TestBase {
-
- private static final String HEADER = "Max-Forwards";
- private static final String VALUE = "123";
- private static final Integer PARSED = 123;
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(maxForwards(VALUE)).run().assertContent(VALUE);
- c.get().header(maxForwards(VALUE)).run().assertContent(VALUE);
- c.get().header(maxForwards(PARSED)).run().assertContent(VALUE);
- c.get().header(maxForwards(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(maxForwards((String)null)).run().assertContent().isEmpty();
- c.get().header(maxForwards((Supplier<Integer>)null)).run().assertContent().isEmpty();
- c.get().header(maxForwards(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(MaxForwards.of((Integer)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/NoTrace_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/NoTrace_Test.java
deleted file mode 100644
index b92accfd85..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/NoTrace_Test.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class NoTrace_Test extends TestBase {
-
- private static final String HEADER = "No-Trace";
- private static final String VALUE = "true";
- private static final Boolean PARSED = Boolean.TRUE;
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(noTrace(VALUE)).run().assertContent(VALUE);
- c.get().header(noTrace(VALUE)).run().assertContent(VALUE);
- c.get().header(noTrace(PARSED)).run().assertContent(VALUE);
- c.get().header(noTrace(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(noTrace((String)null)).run().assertContent().isEmpty();
- c.get().header(noTrace((Supplier<Boolean>)null)).run().assertContent().isEmpty();
- c.get().header(noTrace(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-
- @Test void a02_factoryNullReturn() {
- assertNull(NoTrace.of((Boolean)null));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Origin_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Origin_Test.java
deleted file mode 100644
index 4c69808a6e..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Origin_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Origin_Test extends TestBase {
-
- private static final String HEADER = "Origin";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(origin(VALUE)).run().assertContent(VALUE);
- c.get().header(origin(VALUE)).run().assertContent(VALUE);
- c.get().header(origin(PARSED)).run().assertContent(VALUE);
- c.get().header(origin(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(origin((String)null)).run().assertContent().isEmpty();
- c.get().header(origin((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(origin(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Pragma_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Pragma_Test.java
deleted file mode 100644
index 1b74bc7125..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Pragma_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Pragma_Test extends TestBase {
-
- private static final String HEADER = "Pragma";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(pragma(VALUE)).run().assertContent(VALUE);
- c.get().header(pragma(VALUE)).run().assertContent(VALUE);
- c.get().header(pragma(PARSED)).run().assertContent(VALUE);
- c.get().header(pragma(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(pragma((String)null)).run().assertContent().isEmpty();
- c.get().header(pragma((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(pragma(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ProxyAuthenticate_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ProxyAuthenticate_Test.java
deleted file mode 100644
index 08db9a0343..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ProxyAuthenticate_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ProxyAuthenticate_Test extends TestBase {
-
- private static final String HEADER = "Proxy-Authenticate";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(proxyAuthenticate(VALUE)).run().assertContent(VALUE);
- c.get().header(proxyAuthenticate(VALUE)).run().assertContent(VALUE);
- c.get().header(proxyAuthenticate(PARSED)).run().assertContent(VALUE);
- c.get().header(proxyAuthenticate(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(proxyAuthenticate((String)null)).run().assertContent().isEmpty();
- c.get().header(proxyAuthenticate((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(proxyAuthenticate(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ProxyAuthorization_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ProxyAuthorization_Test.java
deleted file mode 100644
index 1547f6876c..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/ProxyAuthorization_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class ProxyAuthorization_Test extends TestBase {
-
- private static final String HEADER = "Proxy-Authorization";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(proxyAuthorization(VALUE)).run().assertContent(VALUE);
- c.get().header(proxyAuthorization(VALUE)).run().assertContent(VALUE);
- c.get().header(proxyAuthorization(PARSED)).run().assertContent(VALUE);
- c.get().header(proxyAuthorization(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(proxyAuthorization((String)null)).run().assertContent().isEmpty();
- c.get().header(proxyAuthorization((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(proxyAuthorization(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Range_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Range_Test.java
deleted file mode 100644
index 83a103db1b..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Range_Test.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-
-import java.io.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Range_Test extends TestBase {
-
- private static final String HEADER = "Range";
- private static final String VALUE = "foo";
- private static final String PARSED = "foo";
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(range(VALUE)).run().assertContent(VALUE);
- c.get().header(range(VALUE)).run().assertContent(VALUE);
- c.get().header(range(PARSED)).run().assertContent(VALUE);
- c.get().header(range(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(range((String)null)).run().assertContent().isEmpty();
- c.get().header(range((Supplier<String>)null)).run().assertContent().isEmpty();
- c.get().header(range(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
- return MockRestClient.create(A.class);
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Referer_Test.java b/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Referer_Test.java
deleted file mode 100644
index 1ba7f7b39e..0000000000
--- a/juneau-rest/juneau-rest-mock/src/test/java/org/apache/juneau/http/classic/header/Referer_Test.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.http.classic.header;
-
-import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.commons.utils.StringUtils.*;
-import static org.apache.juneau.http.classic.HttpHeaders.*;
-import static org.junit.jupiter.api.Assertions.*;
-
-import java.io.*;
-import java.net.*;
-import java.util.function.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.*;
-import org.apache.juneau.http.*;
-import org.apache.juneau.rest.client.classic.*;
-import org.apache.juneau.rest.mock.classic.*;
-import org.apache.juneau.rest.server.*;
-import org.junit.jupiter.api.*;
-
-// Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-@SuppressWarnings({
- "resource" // Closeable resources in tests are intentionally unassigned; closing is handled by test infrastructure.
-})
-class Referer_Test extends TestBase {
-
- private static final String HEADER = "Referer";
- private static final String VALUE = "foo://bar";
- private static final URI PARSED = URI.create("foo://bar");
-
- @Rest
- public static class A {
- @RestOp
- public StringReader get(@Header(name=HEADER) @Schema(cf="multi") String[] h) {
- return reader(h == null ? "null" : join(h, ','));
- }
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Method tests
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void a01_basic() throws Exception {
- var c = client().build();
-
- // Normal usage.
- c.get().header(referer(VALUE)).run().assertContent(VALUE);
- c.get().header(referer(VALUE)).run().assertContent(VALUE);
- c.get().header(referer(PARSED)).run().assertContent(VALUE);
- c.get().header(referer(()->PARSED)).run().assertContent(VALUE);
-
- // Invalid usage.
- c.get().header(referer((String)null)).run().assertContent().isEmpty();
- c.get().header(referer((Supplier<URI>)null)).run().assertContent().isEmpty();
- c.get().header(referer(()->null)).run().assertContent().isEmpty();
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Helper methods.
- //------------------------------------------------------------------------------------------------------------------
-
- private static RestClient.Builder<?> client() {
... 231606 lines suppressed ...