@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
public @interface RunWithUsers
This annotation works with MultiUserTestRunner JUnit runner. The producer parameter defines which
roles are used to create content and consumers parameter defines which roles are used to
consume content. The syntax and possible values for defining users are same as in
MultiUserTestRunner
.
At least one producer role/user has to be defined. This can be done via array of strings
(producers()
) or using a user definition class
(producerClass()
}).
If user definitions are given with both string array and UserDefinitionClass
are given the
user definitions are merged. This enables to reuse UserDefinitionClass
more.
Annotation can also be user with methods. Then the annotation will define with what users the method
will be executed. If producers()
are set, the method will only be executed if any of the specified producers are
being used as the producer. Same applies for the consumers()
. If both producers and consumers are defined then
the method will be run only if any combination of producers and users are being used.
Modifier and Type | Fields and Description |
---|---|
static java.lang.String |
ANONYMOUS
Don't login at all or clear login details
|
static java.lang.String |
PRODUCER
Login as producer user
|
static java.lang.String |
WITH_PRODUCER_ROLE
Login as a new user that has the same role as the producer.
|
Modifier and Type | Optional Element and Description |
---|---|
java.lang.Class<? extends UserDefinitionClass> |
consumerClass
Consumer roles/users to be used from a user definition class
|
java.lang.String[] |
consumers
Consumer roles/users to be used
|
java.lang.Class<? extends UserDefinitionClass> |
producerClass
Producer roles/users to be used from a user definition class
|
java.lang.String[] |
producers
Producer roles/users to be used
|
public static final java.lang.String WITH_PRODUCER_ROLE
public abstract java.lang.String[] producers
public abstract java.lang.String[] consumers
public abstract java.lang.Class<? extends UserDefinitionClass> producerClass
public abstract java.lang.Class<? extends UserDefinitionClass> consumerClass