Class MockWorkEngineResource

java.lang.Object
ai.pipestream.module.pipelineprobe.mockengine.MockWorkEngineResource

@Path("/mock-engine") @Produces("application/json") public class MockWorkEngineResource extends Object
Control + observability for the MockWorkEngineService. Start a run by (re)loading the corpus to a unit count, then read the stats to assert the module-under-test drained the queue.
  POST /mock-engine/run?count=1000   # serve 1000 fresh units, reset stats
  GET  /mock-engine/stats            # served / acked / byStatus / byDisposition / acksPerSecond
  POST /mock-engine/reset            # drain + clear stats
  • Constructor Details

    • MockWorkEngineResource

      public MockWorkEngineResource()
      Creates the mock work engine control resource. Instances are managed by the JAX-RS runtime.
  • Method Details

    • run

      @POST @Path("/run") public Map<String,Object> run(@QueryParam("count") @DefaultValue("-1") int count)
      (Re)load the corpus with a fresh budget and clear the stats, so the next module to dial in pulls count units.
      Parameters:
      count - number of work units to serve (negative → configured default)
      Returns:
      the cleared stats snapshot plus the total to serve
    • stats

      @GET @Path("/stats") public Map<String,Object> stats()
      Returns the live run statistics together with the total number of units being served.
      Returns:
      the live run stats.
    • reset

      @POST @Path("/reset") public Map<String,Object> reset()
      Drain the corpus and clear the stats.
      Returns:
      the cleared stats snapshot