Home » Java » Enterprise Java

Enterprise Java

RESTful services with HATEOAS: Hypermedia, Optional Or Not?

java-interview-questions-answers

1. Introduction In this last, conclusive part of the tutorial we are going to compile our thoughts, what we have learnt so far, and come up with the answer to a single question: could we ignore hypermedia and HATEOAS altogether, essentially relaxing (intentionally or not) one of the mandatory constraints of REST architectural style, and still pretend we are building ...

Read More »

How to publish jar to Maven central

You created your brand new project and you want to release it to maven central so people can use in their maven based project. It is not a really straightforward thing to accomplish so I wanted to write a step by step guide on it (based on his stackoverflow post).  –Create your jira account on sonatype -Login to your jira ...

Read More »

Backpressure in Project Reactor

java-interview-questions-answers

Project Reactor implements the Reactive Streams specification, which is a standard for asynchronously processing a stream of data while respecting the processing capabilities of a consumer.  At a very broad level, there are two entities involved, a Producer that produces the stream of data and a Consumer that consumes data. If the rate at which a Consumer consumes data is ...

Read More »

Converting JAX-RS parameters with ParamConverters

java-interview-questions-answers

If you want JAX-RS to automatically convert parameters such as query params, path params, or others, you need to create a ParamConverter. Primitive types, strings, and types who define certain conversion methods, such as a valueOf(String) method, are automatically converted. Here’s how to define a converter for LocalDates. One gotcha I ran into a few times — besides the fact ...

Read More »

Ship your function

java-interview-questions-answers

Now a days function as service(FaaS) is trending in serverless area and it is enabling new opportunity that allows to send function on the fly to server and it will start executing immediately.    This is helps in building application that adapts to changing users needs very quickly.Function_as_a_service is popular offering from cloud provider like Amazon , Microsoft, Google etc. FaaS has ...

Read More »

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 completely in order to avoid any errors ...

Read More »

10 JdbcTemplate Examples in Spring Framework

spring-interview-questions-answers

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 you have worked in any real-life JAva project which connects to Database ...

Read More »

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, it fails silently or a MockitoException is thrown. I’d like to explain what causes the “MockitoException: ...

Read More »