Mockito can mock static methods!

Hot news!

Mockito just released version 3.4.0 which can now mock static methods.

Migration to Mockito 2.1

Recently we got a great news.

They released Mockito 2.1.0 - after so many years of hopeless waiting!

There is a lot of cool updates in Mockito 2, including:

  • Support for Java 8
  • Migration from CGLIB to ByteBuddy
  • Mocking final classes and methods

Yes! I must use it! - I decided.

What a huge disappointment it was for me…

Spring boobs

Six years ago I developed an enterprise project with Spring framework.

We believed that Spring is a bloody enterprise.

We wanted to get rid of this boilerplate.

We were young and courage, we wanted changes.

About Legacy code

My interview for About Legacy code without maximalism.

Including: TDD, sport, Sherlock Holmes and real men.

How Java8 can help in writing unit-tests


Typically you need to create a lot of various objects with various states in your tests. But you don’t always have appropriate constructors, and probably don’t want to have too many constructors.

And Java 8 can help here!

Effective UI tests with Selenide

Waiting for miracles

Christmas is a time for miracles. On the eve of the new year we all build plans for the next. And we hope that all problems will leave in the ending year, and a miracle happens in the coming year.

Every Java developer dreams about a miracle that lets him become The Most Effective Java Developer in the world.

I want to show you such a miracle.

It’s called automated tests!

Why IDEA is better than Eclipse

Holy war

There are “eternal” questions that have no single correct answer. E.g. what is better: Windows or Linux, Java or C#; who is stronger, Chuck Norris or Van Damme. One of such holywars is selection of the best Java IDE.

WTF is business logic?


I have heard many times the term “logic” or “business-logic” in discussions about software development. For instance:

  • (about unit-tests) it’s not necessary to achieve 100% code coverage, testing of logic is god enough.
  • (about web applications architecture) controller should not contain any business logic, it only should call other classes’s methods.
  • VIEW layer (e.g. JSP files) should not contain any business logic

Now tell me, what is “logic”?

Inspiration for tests

not translated yet

Unit-test evolution

TDD is not absolute goodness. Tests can be different.

Let’s consider how bad can be unit-test and how can it evolve.

Why the devil invented javadoc?

It is believed that a good program should be well documented.

SUN company even creared a special format javadoc - “a standard for documenting classes Java”. In fact, it was quite a common case in my experience, when a code did not pass Code Review just because some of its methods lacked comments.

Today I’ll tell you why the comments are evil.