Interface ExperimentCases<C,V>

Type Parameters:
C - the command type of the cases, which the agent's command handler must take
V - the reply type of the cases, which the agent's command handler must reply with; Object for cases without an expected reply

@DoNotInherit public interface ExperimentCases<C,V>
The cases of an experiment, before the agent under test is named. Obtained from ExperimentRunner.cases(akka.javasdk.testkit.eval.EvalCase<C, ? extends V>, akka.javasdk.testkit.eval.EvalCase<C, ? extends V>...).

Not for user extension.

  • Method Summary

    Modifier and Type
    Method
    Description
    <A extends akka.javasdk.agent.Agent, R extends V>
    Experiment<V>
    agent(akka.japi.function.Function2<A,C,akka.javasdk.agent.Agent.Effect<R>> method)
    Binds the cases to the agent under test.
  • Method Details

    • agent

      <A extends akka.javasdk.agent.Agent, R extends V> Experiment<V> agent(akka.japi.function.Function2<A,C,akka.javasdk.agent.Agent.Effect<R>> method)
      Binds the cases to the agent under test. Its command handler takes the case's command and replies with the type of the case's expected reply. The evaluators bound to the agent in the configuration the TestKit runs with evaluate every attempt.
      Type Parameters:
      A - the agent type
      R - the reply type of the command handler. It is the reply type of the cases, or a subtype of it. Cases without an expected reply have Object as their reply type and accept a handler with any reply type.
      Parameters:
      method - the agent's command handler, for example SupportAgent::ask
      Returns:
      the experiment builder ready to configure and run
      Throws:
      IllegalArgumentException - when method is null, when a binding names an evaluator id that no evaluator component of the service has, when a binding uses the reserved name ExperimentRunner.TARGET or ExperimentRunner.EXPECTED, or when an evaluator is bound to the agent with a sampling ratio below 1.0, since the experiment waits for every bound evaluator on every attempt