Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!


1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions


and many more ....



Integration testing on REST urls with Spring Boot


We are building a Spring Boot application with a REST interface and at some point we wanted to test our REST interface, and if possible, integrate this testing with our regular unit tests. One way of doing this, would be to @Autowire our REST controllers and call our endpoints using that. However, this won’t give full converage, since it will ...

Read More »


编者按:在Java Code Geeks,我们已经提供了大量JUnit的教程,例如JUnit入门示例,使用JUnit的断言和注释例子,JUnit的注释示例等。然而,我们倾向收集所有的JUnit特性在一个详细的指南以方便读者。我们希望你喜欢它!               目录 1.单元测试的介绍 1.1. 什么是单元测试? 1.2. 测试覆盖 1.3. 在Java中的单元测试 2. JUnit的介绍 2.1. 使用Eclipse JUnit的简单示例 2.2. JUnit的注释 2.3. JUnit断言 3. JUnit的使用Eclipse完整的例子 3.1. 初始步骤 3.2. 创建一个Java类进行测试 3.3. 创建和运行JUnit测试案例 3.4. [email protected] 3.5. 创建测试套件 3.6. 创建参数化测试 3.7. 规则 3.8. 分类 4.在命令行运行JUnit测试 5.结论   1.单元测试的介绍 1.1. 什么是单元测试? 一个单位可以是一个函数,一个类,一个包,或者一个子系统。所以,术语单元测试是指测试这样小单位的代码,以确保它们正常工作。例如,我们可以测试在给定的输入或者某给定条件的情况下,输出是否是我们所希望看到的。这种做法可以帮助开发人员发现代码逻辑背后的故障,提高其代码的质量。另外,单元测试可以用来以确保代码在未来变化中可以正常实现逻辑。 1.2. 测试覆盖 一般情况下,开发社区对关于代码应测试的百分比(测试覆盖)有不同的看法。一些开发者认为代码应该有100%的测试覆盖率,而有些则认为有50%或更低的测试覆盖率也可以。在任何情况下,你应该写测试你的代码中复杂或关键部分。 1.3. 在Java单元测试 在Java中最流行的测试框架是JUnit。本指南主要集中于JUnit,下面的章节有更多测试框架的细节。在Java中另一种流行的测试框架是TestNG。 2. JUnit的介绍 ...

Read More »

Drools 6.2.0.Final Released

We are happy to announce the latest and greatest Drools 6.2.0.Final release. This release in particular had a greater focus on improved usability and features that make the project easier to use (and adopt). Lots of improvements on the workbench UI, support for social activities and plugin management, as well as a brand new Execution Server for rules are among ...

Read More »

What is wrong with troubleshooting tools?

“Troubleshooting is a form of problem solving applied to repair failed software. It is a logical, systematic search for the source of a problem so that it can be solved, and so the software can be made operational again.” This definition from Wikipedia is using fancy words to tell you that – whenever your application is broken, somebody has to ...

Read More »

A beginner’s guide to JPA and Hibernate Cascade Types

Introduction JPA translates entity state transitions to database DML statements. Because it’s common to operate on entity graphs, JPA allows us to propagate entity state changes from Parents to Child entities. This behavior is configured through the CascadeType mappings. JPA vs Hibernate Cascade Types Hibernate supports all JPA Cascade Types and some additional legacy cascading styles. The following table draws ...

Read More »

Prevent ‘No plugin found’ in multi-module maven

Defining a maven plugin on a submodule in a multi-module maven project can give us a ‘No plugin found’ error. Especially if we have a multi-module project and we want to apply a maven plugin in only one specific module this error occur pretty often. Let’s say we have a multi-module root pom which looks like this.       ...

Read More »

Walking Recursive Data Structures Using Java 8 Streams

The Streams API is a real gem in Java 8, and I keep finding more or less unexpected uses for them. I recently wrote about using them as ForkJoinPool facade. Here’s another interesting example: Walking recursive data structures. Without much ado, have a look at the code:             class Tree { private int value; private ...

Read More »

Jenkins to Nexus with Git Polling

Build Binaries Only Once is a very important principle of Continuous Deployment (CD). However that blog guides you to build and deploy binaries to Nexus from your development machine. This is fine as a starting step where everything is locally contained on your laptop and you are just testing setup to figure out how things work. But everybody in the team having a local Nexus repository ...

Read More »

Dogma Driven Development

We really are an arrogant, opinionated bunch, aren’t we? We work in an industry where there aren’t any right answers. We pretend what we do is computer “science”. When in reality, its more art than science. It certainly isn’t engineering. Engineering suggests an underlying physics, mathematical models of how the world works. Is there a mathematical model of how to ...

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:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns