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 doubles #388

Merged
merged 19 commits into from
Apr 24, 2021
Merged

Test doubles #388

merged 19 commits into from
Apr 24, 2021

Conversation

ddreimane
Copy link
Contributor

Testing using test doubles, in particular, test cases that make use of any mocks, spies, fakes, etc.

Copy link
Member

@nightm4re94 nightm4re94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR! Please address the minor issues I mentioned in my review before I can merge.

this.getControllers().addController(controller);
if (Game.world().environment() != null && Game.world().environment().isLoaded()) {
Game.loop().attach(controller);
}
}

protected IEntityAnimationController<?> createAnimationController() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason for removing createAnimationController and createMovementController?

tests/de/gurkenlabs/litiengine/abilities/AbilityTests.java Outdated Show resolved Hide resolved
@nightm4re94 nightm4re94 self-requested a review April 24, 2021 13:01
Copy link
Member

@nightm4re94 nightm4re94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, everything looks fine. Thank you!

@nightm4re94 nightm4re94 merged commit 14894c1 into gurkenlabs:master Apr 24, 2021
@Gamebuster19901
Copy link
Contributor

Gamebuster19901 commented Apr 26, 2021

This PR causes build failures on Java 8.

@ddreimane @jluech @ddreimane @niels89 @nightm4re94

gamebuster@gamebuster-System-Product-Name:~/Desktop/Modding/LitiEngine$ ./gradlew build

> Task :compileTestJava FAILED
/home/gamebuster/Desktop/Modding/LitiEngine/tests/de/gurkenlabs/litiengine/abilities/effects/EffectTests.java:50: error: cannot find symbol
            List.of(new Creature(),
                ^
  symbol:   method of(Creature,Creature,Creature)
  location: interface List
/home/gamebuster/Desktop/Modding/LitiEngine/tests/de/gurkenlabs/litiengine/environment/EntitySpawnerTests.java:87: error: cannot find symbol
            super(List.of(spawnPoint), amount, SpawnMode.ONERANDOMSPAWNPOINT);
                      ^
  symbol:   method of(Spawnpoint)
  location: interface List
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileTestJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
6 actionable tasks: 4 executed, 2 up-to-date

@nightm4re94
Copy link
Member

This PR causes build failures on Java 8.

@ddreimane @jluech @ddreimane @niels89 @nightm4re94

...

Resolved by 44d2eb6.

@jluech
Copy link
Contributor

jluech commented Apr 27, 2021

Resolved by 44d2eb6.

Thanks @nightm4re94! Would not have had time to look at it properly until Thursday at least.

Your commit did introduce some wildcard imports on Mockito, though 😉 and it changed some test method visibility to package-private, I assume that was on purpose.

@nightm4re94
Copy link
Member

nightm4re94 commented Apr 27, 2021

Damn you, IntelliJ! 🗡️ The wildcard import was not on purpose, of course. To configure IntelliJ the right way, see this answer.

Since JUnit5, Test classes, test methods, and lifecycle methods are no longer required to be public, but they must not be private. (See JUnit 5 User Guide.)

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.

None yet

5 participants