Java Code Geeks

Java 2 Java Developers Resource Center

Latest articles

Java Compress/Decompress String/Data

Java provides the Deflater class for general purpose compression using the ZLIB compression library. It also provides the DeflaterOutputStream which uses the Deflater class to filter a stream of data by compressing (deflating) it and then writing the compressed data to another output stream. There...

Optional ofNullable() method (With Examples)

A quick guide to Optional ofNullable() method in Java 8 API with Example programs. How to use in the real time projects. 1. Introduction In this tutorial, We’ll learn Optional ofNullable() example on how to create new Java 8 Optional object for any value or null value. Optional is part of ...

Protractor Tutorial: Handling Timeouts With Selenium

A lot of times while performing Selenium test automation, you’ll come across certain scenarios when your test fails due to the fact that the webpage or the web element takes some time to load completely. In such scenarios, the best approach is to wait for the page or the web elements to load...

10 JdbcTemplate Examples in Spring Framework

Hello guys, If you have been using the Spring framework then you may know that the JdbcTempalte is one of the most useful classes of Spring framework. The JdbcTempalte class provides lots of convenient methods for performing database-related tasks that take the pain away from using the JDBC API. If...

Kotlin / IntelliJ quick hint: Operator navigation

This is just a quick hint if you are programming Kotlin with IntelliJ: In IntelliJ you can ctrl-click on operators to navigate to the operator definition (similar to ctrl-clicking on methods). This also works for the get operator (you can click on the [] brackets) and for ranges (you can click on...

Mockito: Cannot instantiate @InjectMocks field: the type is an abstract class

Anyone who has used Mockito for mocking and stubbing Java classes, probably is familiar with the InjectMocks-annotation. Use this annotation on your class under test and Mockito will try to inject mocks either by constructor injection, setter injection, or property injection. This magic succeeds,...

Testing is Not Sufficient: 5 Ways to Know If Your Code is Really Production-Ready

Enterprises today are all about increasing software delivery velocity. But with shorter release cycles, code quality is usually sacrificed. Today’s DevOps and QA teams are under pressure to prevent code defects from escaping into production, yet they need to also manage unprecedented workloads with...

Mockito: Cannot instantiate @InjectMocks field: the type is an interface

Anyone who has used Mockito for mocking and stubbing Java classes, probably is familiar with the InjectMocks-annotation. Use this annotation on your class under test and Mockito will try to inject mocks either by constructor injection, setter injection, or property injection. This magic succeeds,...

[MEGA DEAL] The All-in-One Six Sigma Certification Bundle (97%)

Be a Better, More Successful Manager & Optimize Project Operations with 31 Hours of Expert-Led Courses on Six Sigma Belts and Lean Method Hey fellow geeks, This week, on our JCG Deals store, we have another extreme offer.We are offering a massive 97% off on The All-in-One Six Sigma...

REST: Creating resources

Resource creation is a common REST API operation. In this post we will see how single resource can be created. The client request Resources are typically created by sending a POST request to the parent collection resource. This creates a new subordinate resources with a newly generated id. For...

Discover, share and read the best on the web

Subscribe to RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters! Get unfiltered news feeds or filter them to your liking.

Get Inoreader
Inoreader - Subscribe to RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters!