public class AnnotationBasedHttpClientListener extends FileWritingHttpClientListener
HttpClientListener
implementation printing the content of the CodeQuality
annotation located
somewhere on the StackTrace.
This feature is introduced to allow the SDK Pipeline to check for certain code qualities at test runtime.
This is not intended for productive usage, but only for tests!
Note: This listener (as all HttpClientListener
implementations) are only automatically called when
HTTP calls are done via the HttpClient
provided by the
HttpClientAccessor
.
The resulting report line will look something like this:
http://0.0.0.0/myEndpoint,"package.to.ResilientClass(RESILIENCE),other.package.to.OtherResilientClass(Some Quality,Another Quality)"So it will have the URI of the called endpoint in the first column and all classes annotated with
CodeQuality
currently on the StackTrace, together with the values of the annotation.Constructor and Description |
---|
AnnotationBasedHttpClientListener() |
AnnotationBasedHttpClientListener(Path reportPath)
Creates a new listener, writing the report into a file at the given path.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getReportValuePerCalledUri()
Returns the value that should be printed in the second column of the report file.
|
onRequest
public AnnotationBasedHttpClientListener(@Nullable Path reportPath)
reportPath
- The path the report should be written to.public AnnotationBasedHttpClientListener()
@Nonnull protected String getReportValuePerCalledUri()
The content of this second column is highly sub-class specific, so look there for more details.
getReportValuePerCalledUri
in class FileWritingHttpClientListener
null
.Copyright © 2019 SAP SE. All rights reserved.