-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@WithAccessId
collides with @ParameterizedTest
#555
Comments
I cannot replicate the problem, I tried running this test I made and it worked fine
|
You probably need to extend the class with |
Here is a minimal working example: import io.kadai.common.test.security.JaasExtension;
import io.kadai.common.test.security.WithAccessId;
import java.time.DayOfWeek;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
@ExtendWith(JaasExtension.class)
public class Test {
@ParameterizedTest
@EnumSource(DayOfWeek.class)
@WithAccessId(user = "user-1-1")
public void test(DayOfWeek day) {}
} |
Ok, I am now able to replicate the problem, will look into it |
Related work: junit-team/junit5#871 & junit-team/junit5#3843 First one seems to be released soon and presents itself as the ideal solution (I guess). |
Here is the cause of the problem. What we would want is: Multiplication. |
… and `@TestTemplate`
Partial workaround for a single |
Update: junit-team/junit5#4315 for Container-Templates has been merged and is probably released with |
Whenever writing parametrized tests that require additional
@WithAccessId
, the tests get created as expected but there is an additional test for every@WithUserId
provided, which in turn fails because it does not provide a value for the actual parameter.E.g. consider:
This will run the following tests:
The first one fails with:
The text was updated successfully, but these errors were encountered: