Home » Java » Enterprise Java (page 3)

Enterprise Java

Monitor Your Java Apps with Spring Boot Actuator

spring-interview-questions-answers

Friends don’t let friends write user auth. Tired of managing your own users? Try Okta’s API and Java SDKs today. Authenticate, manage, and secure users in any application within minutes. Have you worked with Spring Boot Actuator yet? It’s an immensely helpful library that helps you monitor app health and interactions with the app – perfect for going to production! ...

Read More »

How-To: Spring Boot 2 Web Application with Multiple Mongo Repositories and Kotlin

First of all, a disclaimer: if you’re writing a microservice (which everyone does now right?) and want it to be idiomatic, you don’t normally use several different data sources in it. Image taken from Pixabay © https://pixabay.com/illustrations/software-binary-system-1-0-binary-557616/ Why? Well, by definition, microservices should be loosely coupled, so that they can be independent. Having several microservices writing into the same database really ...

Read More »

Selenium Waits: Implicit, Explicit, Fluent And Sleep

Selenium waits for page load play an important part in your Selenium scripts. They help to make them less flaky and more reliable. Selenium provides multiple waits to provide adequate wait or pause in your script execution based on certain conditions. Thereby ensuring you don’t end up getting failed scripts as you perform automation testing with Selenium. In this tutorial, ...

Read More »

Web socket Java client for Stomp-Spring server side

java-interview-questions-answers

Problem : As an analysis for an issue I had to write a simple java web socket client site code connecting to a Spring based application on the server side with a stomp based web socket broker . Solution : pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.rnd</groupId> <artifactId>SockWebsocketClient</artifactId> <version>1.0-SNAPSHOT</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.3.RELEASE</version> </parent> <dependencies> <dependency> ...

Read More »

Seven Testing Sins and How To Avoid Them

Throughout this article I will be using Java within code snippets, whilst also using JUnit and Mockito. This article aims to provide examples of test code which can be: hard to readdifficult to maintain Following these examples the article will attempt to offer alternatives, which can be used to enhance the readability of your tests, which in turn will help ...

Read More »

Crossing The JUnit Streams

One of the nice things about JUnit 5 migration is that you can run your JUnit 4 tests in vintage mode and everything’s still compatible. One of the down sides is that some of the annotations and methods have the same name in JUnit 4 and JUnit 5 and it’s very easy, when both sets of the library dependencies are ...

Read More »

Websockets with Jmeter: Getting Performance Numbers

Problem: I can across a problem recently where it was needed to test performance of SockJs/Stomp Spring websocket broker for multiple users . As WebSockets are asynchronous in nature its trickier then normal http/https request-response testing . Solution: Well it doesn’t need to explain why Jmeter is a good tool for perform this kind of testing , but needed a ...

Read More »

Dockerizing a Spring Boot Application

Hello Friends, In this tutorial,we will see how we can dockerize our Spring Boot Application.By dockerizing ,we mean that we are going to run our application as docker container. Following are the steps involved : 1. Create a Spring Boot Application2. Install Docker on your machine3. Create a Docker file in your project4. Docker build using docker file5. Docker run ...

Read More »

Minimize turnaround times with Open Liberty’s dev mode

java-interview-questions-answers

I’ve uploaded a video in which I show how to reduce the turnaround times while writing Enterprise Java applications that are deployed on Open Liberty. The liberty:dev goal of the Maven plugin watches for file changes and applies the changes instantly, without the need to rebuild the whole deployment artifact. I’ll show how Open Liberty can keep running while we’re ...

Read More »