Home » Tag Archives: Testing

Tag Archives: Testing

Isolating integration tests and mocking dependencies with Spring Boot

spring-interview-questions-answers

Integration tests can be slow and unreliable because they depend on too many components in the system. Up to a certain point, this is unavoidable: integration tests are here to validate how each part of your system plays with other internal or external components. We can, however, improve some integration tests by only spinning up the required dependencies, instead of ...

Read More »

Use JUnit’s expected exceptions sparingly

junit-logo

Sometimes, when we get pull requests for jOOQ or our other libraries, people change the code in our unit tests to be more “idiomatic JUnit”. In particular, this means that they tend to change this (admittedly not so pretty code): @Test public void testValueOfIntInvalid() { try { ubyte((UByte.MIN_VALUE) - 1); fail(); } catch (NumberFormatException e) {} try { ubyte((UByte.MAX_VALUE) + ...

Read More »

Testing: Appetite Comes With Eating

software-development-2-logo

I’ve written a lot about testing. Some tips on integration tests, some how-tos, some general opinions about tests. But I haven’t told my “personal story” about testing. Why are tests needed should be obvious by now. It’s not all about finding bugs (because then you can use an excuse like “QAs will find them anyway”), it’s about having a codebase ...

Read More »

Container Object pattern. A new pattern for your tests.

java-interview-questions-answers

If you search for a description of what Page Object is, you’ll find that The Page Object Pattern gives us a common sense way to model content in a reusable and maintainable way. And also points that: Within your web app’s UI there are areas that your tests interact with. A Page Object simply models these as objects within the ...

Read More »

Effective UI tests with Selenide

java-logo

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 ...

Read More »

Testing multithreaded code in Java

java-logo

Testing multithreaded code is a tough challenge. The first advice that you get when trying to test concurrency is to isolate your concurrent concerns in the code as much as possible. This a general design advice but in this case it’s even more important. Make sure to first properly unit test the logic that is wrapped by the concurrent construct. ...

Read More »

Writing BDD tests with Cucumber JVM

java-logo

Cucumber JVM as an excellent tool to write your BDD tests.In this article I would like to give an introduction to BDD with Cucumber JVM. Let’s get started… What is BDD?           In a nutshell, BDD tries to solve the problem of “understanding requirements with examples” BDD tools There are lot of tools available for BDD ...

Read More »

Introduction in Java TDD – part 2

java-logo

Hello again! In the previous blog post I explained TDD theory in general, without close reference to Java, but in this part we start a TDD practice. Our goal is to go through all phases of TDD: from requirement analysis to refactoring of tested code. All this we will do on example with Java, JUnit and ‘fake’ requirements. Requirements analysis ...

Read More »

Introduction in Java TDD – part 1

junit-logo

Welcome to an introduction in Test Driven Development (TDD) series. We will talk about Java and JUnit in context of TDD, but these are just tools. The main aim of the article is to give you comprehensive understanding of TDD regardless of programming language and testing framework. If you don’t use TDD in your project you are either lazy or ...

Read More »

Enterprise Spring examples and integration tests

spring-interview-questions-answers

There was longer gap in my blog, because I was busy writing book Pivotal Certified Spring Enterprise Integration Specialist Exam – A Study Guide. This book is example heavy. Fortunately Apress agreed to open source all these examples. Therefore there is quite extensive collection of Spring examples available in this GitHub repository. Altogether  146 Spring examples with integration tests. Most of ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials