Skip to content
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

@Test methods with @GoldenMasterRun annotation fail #11

Open
maxbechtold opened this issue Jan 30, 2020 · 2 comments
Open

@Test methods with @GoldenMasterRun annotation fail #11

maxbechtold opened this issue Jan 30, 2020 · 2 comments
Labels

Comments

@maxbechtold
Copy link
Owner

maxbechtold commented Jan 30, 2020

It doesn't matter if there are methods annotated with @GoldenMasterRun or not.

Observed with golden-master 0.6-SNAPSHOT.

Stacktrace:

Suppressed: java.lang.NullPointerException
		at maxbe.goldenmaster.approval.ApprovalIdResolver.getApprovalId(ApprovalIdResolver.java:21)
		at maxbe.goldenmaster.approval.ApprovalIdResolver.resolveApprovalIdFor(ApprovalIdResolver.java:16)
		at maxbe.goldenmaster.junit.extension.RunInvocationContextProvider.afterEach(RunInvocationContextProvider.java:97)
		at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAfterEachCallbacks$11(TestMethodTestDescriptor.java:245)
		at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$12(TestMethodTestDescriptor.java:256)
		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
		at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$13(TestMethodTestDescriptor.java:256)
		at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
		at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAllAfterMethodsOrCallbacks(TestMethodTestDescriptor.java:255)
		at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAfterEachCallbacks(TestMethodTestDescriptor.java:244)
		at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:141)
		... 43 more

@maxbechtold maxbechtold changed the title @Test methods in @GoldenMasterTest fail with Nullpointer exception @Test methods with @GoldenMasterRun annotation fail Feb 3, 2020
@maxbechtold
Copy link
Owner Author

This is a problem with annotations - if more than one TestDescriptor exists (which JUnit prints a warning for), all descriptors will be handled by the harness. This fails since it is designed to work with the GoldenMasterRun annotation

maxbechtold added a commit that referenced this issue Feb 3, 2020
@maxbechtold
Copy link
Owner Author

Example for reproduction:

@GoldenMasterRun
@Test
void aTestWithMultipleAnnotations() {
   ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant