Package akka.javasdk.testkit.eval
Interface ExperimentCases<C,V>
- Type Parameters:
C- the command type of the cases, which the agent's command handler must takeV- the reply type of the cases, which the agent's command handler must reply with;Objectfor 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 TypeMethodDescription<A extends akka.javasdk.agent.Agent,R extends V>
Experiment<V> 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 typeR- 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 haveObjectas their reply type and accept a handler with any reply type.- Parameters:
method- the agent's command handler, for exampleSupportAgent::ask- Returns:
- the experiment builder ready to configure and run
- Throws:
IllegalArgumentException- whenmethodis null, when a binding names an evaluator id that no evaluator component of the service has, when a binding uses the reserved nameExperimentRunner.TARGETorExperimentRunner.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
-