How to ​​Save Time ​by Writing ​Less Test Code

Video Course: ​110 lessons

​Are you tired of writing tests ​that slow you down?

​I think that too many developers are suffering from the effects of bad ​tests. If you are reading this page, the odds are that you are one of them. If this is the case, you are most likely suffering from some (or all) of these problems:

  • ​Your unit tests have a lot of duplicate code and many of your tests are testing the same thing over and over again.
  • ​It takes too much work to maintain the ​test data used by your integration and end-to-end tests.
  • Developers don't want to write integration and end-to-end tests because writing them feels too complicated.
  • ​No one writes end-to-end tests because even a small UI change breaks them.

These problems have two consequences:

First, no one wants to make changes to existing code because updating the existing tests is too painful and takes too much time.

Second, ​​​developers ​are less likely to write tests for new code because they think that writing them is a waste of time.

Is this a bad situation? Well, maybe not. It's true that sometimes writing ​tests is not worth it. However, if you are frustrated with your current situation and you want to get different results, you have to do something different.

If you are struggling to write good ​tests, you are not alone

It's not easy to write good ​tests. It's a skill that requires years of work and often involves at least a few costly mistakes. To make matters worse, you are working in a constantly changing environment that doesn't necessarily appreciate (or support) your efforts to learn this skill.

The Test With Spring course helps you to overcome these obstacles and frees you to enjoy from these three benefits:

  • 1
    ​It's quite common that you don't have time to write automated tests because your manager pressures you to write new features. Nevertheless, if you select the right test cases and write your tests on the right level, you can write less test code without sacrificing your test coverage.
  • 2
    ​If your requirements are changing constantly and your existing tests make this change harder, you ​can still build a better tomorrow. If you use the right techniques, you can write tests that don't tie your hands and slow you down when you make changes to your code.
  • 3
    ​Often developers aren't writing integration and end-to-end tests because ​they think that writing them is too complicated and / or creating stable test data that doesn't require a lot of maintenance is too hard. I am not going to lie to you. Writing these tests takes more work than writing unit tests, but you can use tools and techniques that minimize this overhead.

​What the Test With Spring Course ​teaches to you​:

​4 ​modules that​ help you to work smarter instead of harder

​Validate the Design of Your Application

​41 lessons

The Unit Testing module helps you to validate your design, document your code, and write unit tests that embrace change. You will learn to:

  • ​Run unit tests with Maven and Gradle.
  • Build test data in a less verbose way.
  • Write clean assertions.
  • Get familiar with different test doubles.
  • Create test doubles with less code.
  • ​​Leverage the power of nested configuration.
  • Write unit tests for Spring web applications.

​Write Tests That Don't Make You Cry

20 lessons

​The Integration Testing module helps you to keep your users safe and verify that your backend is working ​correctly. You will learn to:

  • Run integration tests with Maven and Gradle.
  • ​Create data sets that are easy to read and maintain.
  • ​Write integration tests for Spring repositories.
  • Write integration tests for Spring web applications.
  • Isolate the tested code from external APIs.
  • Configure the application context of your application in a way that supports testing.

​Don't Deploy Broken ​Code to Production

​19 lessons

The End-to-End Testing module helps you to ensure that you don't deploy broken features into production and rewrite your tests when you make changes to the user interface. You will learn to:

  • ​Run end-to-end tests ​with Maven and Gradle.
  • Verify that your migration scripts can create a working database.
  • ​Initialize your database into a known state.
  • Write end-to-end tests that are easy to ​maintain
  • Write end-to-end tests for a​ Spring web application.
  • Write end-to-end tests for a ​JS web application.

​Write (Even) Less Test Code

​30 lessons

​The Polyglot Testing module helps you to ​leverage the less verbose syntax of the Groovy programming language and transform your tests into executable specifications that ​are both easy to read and maintain. You will learn to:

  • Run Spock tests ​with Maven and Gradle.
  • ​​Leverage the less verbose syntax of Groovy.
  • ​Describe requirements by using plain English.
  • Structure requirements by using feature methods.
  • ​Create test doubles with Spock Framework.
  • Write unit, integration, and end-to-end tests with Spock Framework.

About the Author

My name is Petri Kainulainen, and I am ​specialized in automated testing and software development with the Spring Framework. ​I have also written a book about Spring Data, and ​I write a popular Java blog that has attracted over 1,9 million visitors in 2017.

​Six years ago I wrote a lot of automated tests. ​​My goal was to write ​clean ​tests, but ​I didn't ​understand what ​I should do. Thus, I ended up writing a lot of tests on autopilot. This lead into a maintenance nightmare.

​I had a lot of automated tests, but I didn't have time to feel proud of myself because I was too busy fixing my existing tests. ​I tried to solve my problems by working harder, but after a while I ​had to admit that it wasn't working.

I realized that my problem wasn't lack of effort. It was lack of time, and I couldn't solve this problem by working harder because time is a very limited resource. That's why I had to find a way to work smarter.

​​I have spend the last ​six years improving my testing skills. I have written countless test cases, and I have also rewritten many of them after I learned a better way of doing things.

Now I want to share my findings with you.


I use your blog as a reference

Thank you for the awesome Spring MVC unit testing tutorials. I use your blog as a reference whenever I get lost in configuration.

Jef Cruz Software Developer

What You'll Get

​Almost all lessons have a video. This video concentrates on writing code, and it demonstrates how you can achieve the goals of the lesson.


​All lessons have an article that ​contains the same information as the video, and it also provides links to ​other resources that ​can be used for further study.


​Every lesson includes an example application that contains the source code ​written during the lesson. You can get these examples from Github.


What ​My Students Are Saying...

I really enjoyed the course

At first I hesitated to buy this course because it was a bit expensive and I wasn't sure if I have time to finish it.

However, after I purchased the starter package of the Test With Spring course, I noticed that it offers both high quality blog format as well as video presentations. The course material is well-written and the course describes techniques that can easily applied.

The only downside is that the video voice presentation style could be a bit more engaging. It feels a little flat sometimes.

Nevertheless, I really enjoyed the course and would recommend the course because it describes a ton of practical techniques that can be easily adopted. Also, the curated links provide great starting points for further study.

Magnus Smith Senior Engineer

I could and can benefit from information and examples provided at this course

It was an easy to decision to buy the master package because the Test With Spring course has a 30 day money back guarantee that allowed me to to check whether it fits my needs, wishes, and requirements.

This course is a real systematic, complete and deep trail through testing topics for Java. The course provides a good balance between information, presenter examples and possibilities for the students to jump deeper in special topics.

I would recommend this course because I could and can benefit from information and examples provided at this course.

Bernd Fischer Software Developer

The master package is a good in depth course

The master package is a good in depth course with everything from the basics of unit tests to integration tests, and how to build/separate integration and unit tests. It provides in depth details and links to other articles that provide even more information.

I recommend this course to anyone who is interested to learn more about testing using Spring MVC. I haven't run across any other resource that has as much information in the topic.

Magnus Lassi Senior Software Engineer

Is This Course Right For You?

​Even though I have put a lot of effort for creating this course, I understand that this course is not suitable for everyone. This section will help you to decide if this course is right for you.

Who is this for

  • ​You want to write automated tests.
  • ​You ​are using either Spring or Spring Boot.
  • ​You have experience from Spring Framework.

Who is this not for

  • ​You ​don't care about automated testing.
  • ​You ​want to write tests for ​Java EE applications.
  • ​You have no experience from Spring Framework.

​I have put a lot of effort for planning and creating the lessons of this course, and I am confident that you will be satisfied for it. That is why I will offer a 30 day money back guarantee.

If you are not satisfied, just contact support withing 30 days of your purchase and you will get your money back. No questions asked.

Start Today! Choose Your Package

Starter Package​

$ 79

  • ​41 lessons
  • ​Unit Testing module
  • Handouts
  • Example projects
  • Lifetime access

Master Package

$ 299

  • ​110 lessons
  • ​Unit, Integration, End-to-End, and Polyglot Testing modules
  • Handouts
  • Example projects
  • ​Lifetime access              

Intermediate Package

$ 179

  • ​80 lessons
  • ​Unit, Integration, and End-to-End Testing modules
  • ​Handouts
  • Example projects
  • Lifetime access


Here are answers to some frequently asked questions:

Can I study on my own pace?

Yes. After you have purchased a package, you have a lifetime access to it. There is no time limit, and you can watch the lessons as many times as you want.

Can I ​see a sample lesson before I decide?

Of course. ​​I have released 28 sample lessons that allow you to take a closer at the course material before you spend any money on my course.

​Do you plan to update the material of this course?

Yes. I think that this course is never ready. ​That's why ​I am currently recording the second ​version of this course. 

Th​e second version of the Test With Spring course will use the latest Spring and Spring Boot versions, and ​it will describe how you can write unit, integration, and end-to-end tests with JUnit 4 and 5. Also, I will rewrite all lessons and record new video lessons.

​All updates are free to my existing students.

​Wh​ich JUnit and Spring versions are used on this course?

At the moment this course uses the following versions:

  • JUnit 4. This course uses JUnit 4 because JUnit 5 was not released when I started to record this course.
  • Spring ​4.3.X. Different packages use different Spring versions because I used the latest available version when I wrote the example applications.
  • Spring Boot 1.4.0 - 1.5.8. ​Different packages use different Spring Boot versions because I used the latest available version when I wrote the example applications.

​Can I ​get a discount?

​​​Unfortunately I don't offer any discounts (or coupons) to new customers because it would be unfair to the people who paid the full price.

​How can I get a refund?

I offer a 30 day money back guarantee. If you are not satisfied, just contact support within 30 days of your purchase, and you will receive a refund. 

No questions asked.

​Can I upgrade my package?

​Yes. If you want to upgrade your package, you have to contact support because the system cannot handle this automatically. When you upgrade your package, you have to pay the difference between your new package and old package.

Don't be Left Behind: Get ​Test With Spring Course Today!

© Koodikupla Oy 2016-2018