Dmaap client
[transportpce.git] / dmaap-client / src / test / java / org / opendaylight / transportpce / dmaap / client / resource / EventsApiStub.java
diff --git a/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/resource/EventsApiStub.java b/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/resource/EventsApiStub.java
new file mode 100644 (file)
index 0000000..c71e0a9
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2021 Orange, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.dmaap.client.resource;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import org.opendaylight.transportpce.dmaap.client.resource.model.CreatedEvent;
+
+@Path("/events")
+public class EventsApiStub {
+
+    @POST
+    @Consumes(MediaType.APPLICATION_JSON)
+    @Produces(MediaType.APPLICATION_JSON)
+    @Path("/{topic}")
+    public CreatedEvent sendEvent(@PathParam("topic") String topic, String event) {
+        CreatedEvent response = new CreatedEvent();
+        response.setCount(1);
+        response.setServerTimeMs(1);
+        return response;
+    }
+
+}