Skip to content

Enum class cast exception when using varargs generic constant parameter in step #123

Description

@pilshchikov

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lcom.examples.tests.MainTest$Params;

	at com.examples.tests.MainTest$AjcClosure1.run(MainTest.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at io.qameta.allure.aspects.StepsAspects.step(StepsAspects.java:46)
	at com.examples.tests.MainTest.paramSteps(MainTest.java:81)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

    @Test
    public void testWithParams() {
        paramSteps(FirstParam.PARAM_1, SecondParam.PARAM_2);
    }

    @Step
    public <T extends Params> void paramSteps(T... param) {}

    enum FirstParam implements Params {
        PARAM_1
    }

    enum SecondParam implements Params {
        PARAM_2
    }

    interface Params {}

What is the expected behavior?

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2+
Test framework [email protected]
Allure integration [email protected]
Generate report using [email protected]
AspectJWeaver 1.8.10

Other information

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions