I quite dislike EasyMock (I think it leads to brittle tests that
over-couple test code with production code). But that comment aside, I
think it is reasonable to use static imports for DSL-type stuff in tests,
which it sounds like what you are suggesting. So that sounds good to me. I
would still suggest generally avoiding them in production code.

On Fri, Nov 8, 2019 at 1:40 AM Roman Leventov <leven...@apache.org> wrote:

> It seems to me that Druid's policy to prohibit static imports makes more
> harm than good in unit test code. It discourages the usage of static
> fixtures and encourages abstraction/inheritance, as I discussed here:
> https://github.com/apache/incubator-druid/pull/8564#issue-319753256, see
> "Refactoring of tests" section.
>
> Alternative: allow only static imports from selected classes: Assert,
> Assertions, EasyMock, etc. IntelliJ's "Static import" inspection supports
> such fine configuration.
>

Reply via email to