commands icon indicating copy to clipboard operation
commands copied to clipboard

Unit testing class with CommandManager as a member? (NoClassDefFoundError)

Open leviem1 opened this issue 3 years ago • 0 comments

I'm trying to unit test a class that wraps a CommandManager. I can't inject a mock CommandManager object into the object I'm testing as CommandManager#log() uses LogLevel which is package private, so I can't implement it. Also, PaperCommandManager throws java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/ints/Int2ObjectOpenHashMap at runtime, so I can't just mock the objects it uses.

Any help would be much appreciated. I think this could be resolved by making LogLevel protected or public. Thanks for the amazing library, helped me more than you could imagine.

leviem1 avatar Jul 05 '21 01:07 leviem1