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

build: fix mockito compilation errors in tests #44

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

BenjaminAmos
Copy link
Contributor

This pull request fixes a compilation error which causes the unit tests to fail.

Currently CI fails with the following error:

> Task :compileTestJava
/home/jenkins/agent/workspace/sology_Modules_P_PolyWorld_PR-43/src/test/java/org/terasology/polyworld/TinyEnvironment.java:18: error: cannot find symbol
import org.mockito.Matchers;
                  ^
  symbol:   class Matchers
  location: package org.mockito
/home/jenkins/agent/workspace/sology_Modules_P_PolyWorld_PR-43/src/test/java/org/terasology/polyworld/TinyEnvironment.java:78: error: cannot find symbol
        Mockito.when(blockManager.getBlock(Matchers.<BlockUri>any())).thenReturn(air);
                                           ^
  symbol:   variable Matchers
  location: class TinyEnvironment
/home/jenkins/agent/workspace/sology_Modules_P_PolyWorld_PR-43/src/test/java/org/terasology/polyworld/TinyEnvironment.java:79: error: cannot find symbol
        Mockito.when(blockManager.getBlock(Matchers.<String>any())).thenReturn(air);
                                           ^
  symbol:   variable Matchers
  location: class TinyEnvironment

Mockito re-named its Matchers class to ArgumentMatchers. The version of Mockito in use was upgraded with the Java 17 changes.

@soloturn soloturn merged commit 9971c0e into develop Dec 15, 2023
12 checks passed
@soloturn soloturn deleted the fix/tests-mockito-fix branch December 15, 2023 10:38
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 this pull request may close these issues.

2 participants