Category Archives: Java

HSEARCH400080: Unable to detect the Elasticsearch version running on the cluster

Description I recently decided to use the elasticsearch and hibernate bindings in java. Hibernate is already a very good ORM and has come a long ways in the last several years, but the integration with elasticsearch and lucene make it an amazing combination. It cuts down on the maintenance of keeping an elasticsearch index up […]

FirstOrDefault C# Lambda to Java 8 Lambda

Description While converting c# code to java there are several lambdas that c# has that were a little difficult to find a port to java. One of these was C Sharp’s FirstOrDefault lambda expression. Java has an equivalent stream. We can use the findFirst and if it doesn’t find anything then we can return a […]

C Sharp delegate function in Java

Porting from C# to Java – The Delegate The delegate function is kind of cool in C# land. It allows you to pass a bunch of functions as a parameter. Java has a handful of different ways you can do this. I personally like just passing an object that implements Runnable and then have an […]

Spring Rest Endpoint Test With MockMVC + ApplicationEvent

Problem Addressed In a service oriented architecture, known as SOA, we have several microservices that get regularly deployed. The  strategy and various needs of deployment of such services has already been solved by applications like kubernetes. From a quality perspective there needs to be a high level test after any service is deployed or any […]

How To Build An API

What is an API API stands for application program interface. In a nutshell an API is a way for external applications to access information and queries from your program. Twitter for example has a a REST API that allows you to access all types of data from twitter. REST API’s are among the most common types of […]

Using groovy closures in Spock where blocks

Groovy Spock vs Java jUnit Because Spock is just jUnit under the hood we can do everything we can in jUnit and more because Spock uses groovy. One aspect of the jUnit test framework that most people don’t take advantage of is using parameterized classes – making the test class be test driven. The best part […]

How to become a software developer

How to become a software developer I am a software engineer and I often have people, whether they are in marketing, customer support, business development, or any other various positions in companies I have worked for, ask me “How to become a software developer?” So you want to learn to code. One of my favorite […]

Multiple environments through GEB

I’ve recently been experimenting with GEB, which is a selenium framework that uses the groovy language. One of first challenges I encountered was trying to switch between multiple environments, instances, subdomains, or base urls. GEB uses a config file called GebConfig.groovy that is a standard groovy configuration file. This file is read by the ConfigSlurper […]

Connecting to an API WSDL through Java REST

Description Java seems to have a pretty decent library for dealing with WSDL soap transactions, however there doesn’t seem to be any great library out there for dealing with rest. The solution is to using java’s built httpconnection library to post the information to the appropriate url and wait for a response. For REST protocol […]