Skip to content

Commit

Permalink
Check for load tests on the metadata endpoint too
Browse files Browse the repository at this point in the history
  • Loading branch information
halprin committed Jan 3, 2025
1 parent 7f8b16b commit 7896fd0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ DomainResponse handleResults(DomainRequest request) {
}

DomainResponse handleMetadata(DomainRequest request) {
if (Boolean.parseBoolean(request.getHeaders().get("load-test"))
&& ApplicationContext.isPropertyPresent("REPORT_STREAM_URL_PREFIX")) {
ApplicationContext.registerForThread(
RSEndpointClient.class, MockRSEndpointClient.getInstance());
}

try {
String metadataId = request.getPathParams().get("id");
Optional<PartnerMetadata> metadataOptional =
Expand Down Expand Up @@ -227,7 +233,7 @@ protected DomainResponse handleMessageRequest(
boolean markMetadataAsFailed = false;
String errorMessage = "";

if ("True".equals(request.getHeaders().get("load-test"))
if (Boolean.parseBoolean(request.getHeaders().get("load-test"))
&& ApplicationContext.isPropertyPresent("REPORT_STREAM_URL_PREFIX")) {
ApplicationContext.registerForThread(
RSEndpointClient.class, MockRSEndpointClient.getInstance());
Expand Down

0 comments on commit 7896fd0

Please sign in to comment.