davidradl commented on code in PR #38:
URL:
https://github.com/apache/flink-connector-http/pull/38#discussion_r3014274395
##########
flink-connector-http/src/test/java/org/apache/flink/connector/http/app/AbstractJsonTransform.java:
##########
@@ -18,27 +18,30 @@
package org.apache.flink.connector.http.app;
-import com.github.tomakehurst.wiremock.common.FileSource;
-import com.github.tomakehurst.wiremock.extension.Parameters;
-import com.github.tomakehurst.wiremock.extension.ResponseTransformer;
-import com.github.tomakehurst.wiremock.http.Request;
+import com.github.tomakehurst.wiremock.extension.ResponseTransformerV2;
import com.github.tomakehurst.wiremock.http.Response;
+import com.github.tomakehurst.wiremock.stubbing.ServeEvent;
+import com.github.tomakehurst.wiremock.verification.LoggedRequest;
-import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
/**
- * Wiremock Extension that prepares HTTP REST endpoint response body. This
extension is stateful,
- * every next response will have values like id == counter, id2 == counter + 1
and uuid =
- * randomValue value in its response, where counter is incremented for every
subsequent request.
+ * Abstract base class for WireMock response transformers that generate JSON
responses with
+ * counter-based IDs and configurable UUID behavior.
*
- * <p>This class is used for AppDemo Wiremock.
+ * <p>Subclasses must provide:
+ *
+ * <ul>
+ * <li>Transformer name via {@link #getName()}
+ * <li>JSON template via {@link #getJsonTemplate()}
+ * <li>UUID generation strategy via {@link #getUuidValue()}
+ * </ul>
*/
-public class JsonTransform extends ResponseTransformer {
+public abstract class AbstractJsonTransform implements ResponseTransformerV2 {
Review Comment:
ResponseTransformer was deprecated so I updated this to use the recommended
interface. I also refactored to avoid duplicated code and gave the json
transforms unque names.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]