GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.9k stars 273 forks source link

Reduce usage of PowerMock #876

Closed Pr0methean closed 6 years ago

Pr0methean commented 6 years ago

Fixes #875

Makes GlowWorld, GlowServer and GlowScoreboardManager non-final. Makes EventFactory a non-final singleton, and changes its methods to instance methods. GlowEntityTest now uses PowerMock to mock Bukkit.getServer(), but not to alter any other class. Several non-entity tests also make less use of PowerMock, and two no longer use it at all.

Saves about 3 minutes on the full suite of tests. A follow-up PR will eliminate most static mocking of Bukkit and will bring the running time back into the 3-4 minute range.