Mockito can mock static methods!
07.11.2020

Hot news!

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

Gradle vs Maven
01.25.2019

The eternal holy war: “Maven is better than Gradle”.

Let me share my arguments for why I personally prefer Gradle. I’ve been using it since 2011 in Selenide, RePlay and most of my work projects.

Most often I hear arguments for Maven like these:

  • Maven is tailored for a standard project structure, and most projects are standard anyway
  • Maven’s XML gives you autocompletion
  • Who cares that Maven downloads the whole internet - the internet is fast and cheap nowadays

Let’s figure it out.

Open space is not evil
08.20.2018

Haven’t you heard that open space is evil?

Somebody asked me this on the internet recently.

No, I haven’t. We have an open space, and everything’s fine, everything works.

Let’s figure it out.

Spark doesn't mark session cookie as HttpOnly
06.22.2018

Ahtung! I recently discovered that Spark framework doesn’t add the HttpOnly attribute to the session cookie.

This means there is a security hole in every web application that uses Spark.

Why IFs in tests are evil
05.15.2018

I often say that IFs in tests are evil.

People often ask me why. Here is my answer.

Migration to Mockito 2.1
10.11.2016

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
10.03.2016

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
08.26.2016

My interview for jug.ru About Legacy code without maximalism.

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

How Java8 can help in writing unit-tests
04.11.2016

Problem

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
12.31.2015

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
12.12.2012

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?
03.03.2011

Question

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
02.10.2011

not translated yet

Unit-test evolution
10.29.2010

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?
05.02.2010

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.