Home » Author Archives: Alex Soto (page 3)

Author Archives: Alex Soto

Testing client side of RESTful services

json-logo

Develop an application that uses RESTful web API may imply developing server and client side. Writing integration tests for server side can be as easy as using Arquillian to start up server and REST-assured to test that the services works as expected. The problem is how to test the client side. In this post we are going to see how ...

Read More »

Jenkins: Deploying JEE Artifacts

jenkins-logo

With the advent of Continuous Integration and Continuous Delivery , our builds are split into different steps creating the deployment pipeline. Some of these steps can be for example compile and run fast tests, run slow tests, run automated acceptance tests, or releasing the application, to cite a few. The final steps of our deployment pipeline, implies a deployment of ...

Read More »

Observer Pattern with Spring Events

spring-interview-questions-answers

INTRODUCTION The essence of the Observer Pattern is to ‘Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.’ GoF. Observer pattern is a subset of publish/subscribe pattern which allows a number of observer objects to see an event. This pattern can be used in different situations, but in ...

Read More »

Build Flow Jenkins Plugin

jenkins-logo

Most of us we are using Jenkins/Hudson to implement Continuous Integration/Delivery, and we manage job orchestration combining some Jenkins plugins like build pipeline, parameterized-build, join or downstream-ext. We require configuring all of them which implies polluting the job configuration through multiple jobs, which takes the system configuration very complex to maintain. Build Flow enables us to define an upper level ...

Read More »

Answering with Mockito

mockito-logo

When you are writing unit tests, you must keep in mind to not have dependencies to external components. To avoid this we use mock frameworks which for me the easiest one to use is Mockito. In this post we are going to see an ‘advanced’ technique used in Mockito to return same argument instance on a mocked method using Answer ...

Read More »

Bye, Bye, 5 * 60 * 1000 //Five Minutes, Bye, Bye

java-logo

In this post I am going to talk about one class that was first introduced in version 1.5, that I have used too much but talking with some people they said that they didn’t know it exists. This class is TimeUnit. TimeUnit class represents time durations at a given unit of granularity and also provides utility methods to convert to ...

Read More »

NoSQLUnit 0.3.0 Released

nosqlunit-logo

Introduction Unit testing is a method by which the smallest testable part of an application is validated. Unit tests must follow the FIRST Rules; these are Fast, Isolated, Repeatable, Self-Validated and Timely. It is strange to think about a JEE application without persistence layer (typical Relational databases or new NoSQL databases) so should be interesting to write unit tests of ...

Read More »

Testing Abstract Classes and Template Method Pattern

java-interview-questions-answers

From wikipedia “A template method defines the program skeleton of an algorithm. One or more of the algorithm steps can be overridden by subclasses to allow differing behaviors while ensuring that the overarching algorithm is still followed”. Typically this pattern is composed by two or more classes, one that is an abstract class providing template methods (non-abstract) that have calls ...

Read More »

Log JDBC operations with Log4jdbc

log4jdbc-logo

When we develop any application, after we finish it or when we end up any of its module, we start optimization process. Most applications contain database access, and if you are using an ORM, probably you will use hibernate. Optimizing hibernate persistence layer,requiresto be prepared to read, understand and evaluate sql. If we take an overview on hibernate configuration, two ...

Read More »

Hibernate Tip: Sort and Order

jboss-hibernate-logo

Let’s introduce another hibernate performance tip. Do you remember the model of previous hibernate post? We had a starship and officer related with a one to many association.                 @Entity public class Starship { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE) private Long id; public Long getId() {return id;} protected void setId(Long id) {this.id = id;} @OneToMany(mappedBy="starship", cascade={CascadeType.ALL}) ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.