Skip to content

Commit c683b90

Browse files
committed
add a hint method in caller to expose the path
1 parent c7e8f78 commit c683b90

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

validator/src/main/java/com/amazon/aoc/callers/HttpCaller.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@
3232
@Log4j2
3333
public class HttpCaller implements ICaller {
3434
private String url;
35+
private String path;
3536

37+
/**
38+
* construct httpCaller.
39+
* @param endpoint the endpoint to call, for example "http://127.0.0.1:8080"
40+
* @param path the path to call, for example "/test"
41+
*/
3642
public HttpCaller(String endpoint, String path) {
43+
this.path = path;
3744
this.url = endpoint + path;
3845
log.info("validator is trying to hit this {} endpoint", this.url);
3946
}
@@ -73,4 +80,9 @@ public SampleAppResponse callSampleApp() throws Exception {
7380

7481
return sampleAppResponseAtomicReference.get();
7582
}
83+
84+
@Override
85+
public String getCallingPath() {
86+
return path;
87+
}
7688
}

validator/src/main/java/com/amazon/aoc/callers/ICaller.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@
1919

2020
public interface ICaller {
2121
SampleAppResponse callSampleApp() throws Exception;
22+
23+
String getCallingPath();
2224
}

validator/src/main/java/com/amazon/aoc/validators/TraceValidator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public void validate() throws Exception {
7777
throw new BaseException(ExceptionCode.DATA_MODEL_NOT_MATCHED);
7878
}
7979
}
80+
81+
log.info("validation is passed for path {}", caller.getCallingPath());
8082
}
8183

8284
// this method will hit get trace from x-ray service and get retrieved trace

0 commit comments

Comments
 (0)