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

Regression with InOrder verification after #2369 #2394

Closed
cushon opened this issue Aug 19, 2021 · 5 comments · Fixed by #2395
Closed

Regression with InOrder verification after #2369 #2394

cushon opened this issue Aug 19, 2021 · 5 comments · Fixed by #2395

Comments

@cushon
Copy link
Contributor

cushon commented Aug 19, 2021

The following test starts failing after 123beb8. It looks like the change to call actual equals and hashCode methods is catching a call to equals inside the implementation of InOrder.

package com.test;

import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.spy;

import org.junit.Test;
import org.mockito.InOrder;

public class AppTest {

  static class Foo {
    void foo() {}
  }

  @Test
  public void test() {
    Foo mock1 = spy(new Foo());
    Foo mock2 = spy(new Foo());
    mock1.foo();
    InOrder order = inOrder(mock1, mock2);
    order.verify(mock1).foo();
    order.verifyNoMoreInteractions();
  }
}
No interactions wanted here:
-> at com.test.AppTest.test(AppTest.java:22)
But found this interaction on mock 'foo':
-> at java.base/java.util.LinkedList.indexOf(LinkedList.java:609)
	at com.test.AppTest.test(AppTest.java:22)
@smcvb
Copy link

smcvb commented Aug 20, 2021

I am experiencing a similar issue after upgrading to version 3.12.0.
More specifically, the AnnotatedSagaRepositoryTest#testLoadedFromNestedUnitOfWorkAfterCreateAndStore test (found here) has started failing, and it follows a similar pattern as described by @cushon.
You can find the failing issue in the GitHub Actions under Axon Framework issue #1913.

@TimvdLippe
Copy link
Contributor

Thanks for reporting! Taking a look now to figure out what is going on here.

@TimvdLippe
Copy link
Contributor

Fix up at #2395

@TimvdLippe
Copy link
Contributor

3.12.1 is currently being pushed to Maven Central. It should be available in a couple of hours.

@smcvb
Copy link

smcvb commented Aug 23, 2021

Thanks for the quick fix here, @TimvdLippe. I can confirm that 3.12.1 solved the aforementioned problem for Axon Framework.

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

Successfully merging a pull request may close this issue.

3 participants