Annotation Interface Name
Disambiguating annotation for declarations of type KafkaCluster,
Producer etc.
when there are multiple KafkaClusters in scope.
For example, consider the following declaration:
KafkaCluster clusterA;
KafkaCluster clusterB;
@Test
public void myTest(Producer<String, String> producer)
*
KafkaClusterExtension will fail parameter resolution with
AmbiguousKafkaClusterException in this case
because it's not clear whether producer should be configured for
clusterA or clusterB.
You can disambiguate the code using @Name, like this:
@Name("A") KafkaCluster clusterA;
@Name("B") KafkaCluster clusterB;
@Test
public void myTest(@Name("A") Producer<String, String> producer)
*
Where the @Name on the declaration of producer
associates it with clusterA.
-
Required Element Summary
Required Elements
-
Element Details
-
value
String valueValue of the name.- Returns:
- the value
-