Home » Java » Enterprise Java

Enterprise Java

Integrating JSON Schema validation in Spring using a custom HandlerMethodArgumentResolver

In previous posts we learned about JSON Schema and how we can validate a JSON document against a JSON Schema in Java. In this post we will integrate JSON Schema validation into Spring controllers using a custom HandlerMethodArgumentResolver. We will use the same JSON document and JSON Schema as in previous posts. So, what is a HandlerMethodArgumentResolver? Handler methods in ...

Read More »

REST: Managing One-To-Many relations

java-interview-questions-answers

In a previous post we looked at many-to-many relations. This time we will see how to model one-to-many relations in a RESTful API. An important question here is, if both sides of the relation can exist on their own (similar to typical many-to-many relations) or if the many-side is tightly coupled to the one-side. In the following we will examine ...

Read More »

JSON Schema validation in Java

In this post we will see how to validate a JSON document against a JSON Schema in Java. We will use the same JSON document and Schema as in the previous post about JSON Schema. You can find both as text files on GitHub: JSON document and JSON Schema. We use the networknt JSON Schema validator library in this example. ...

Read More »

Validating and documenting JSON with JSON Schema

JSON Schema is a way to describe a JSON document. You can think of XML Schema for JSON. It allows you to define required elements, provide validation constraints and documentation. I think the easiest way to explain JSON Schema is to look at an example snippet of JSON and the corresponding JSON Schema. So, I created an image that shows ...

Read More »

Diving Into Istio 1.6 Certificate Rotation

java-interview-questions-answers

Istio is a powerful service mesh built on Envoy Proxy that solves the problem of connecting services deployed in cloud infrastructure (like Kubernetes) and do so in a secure, resilient, and observable way. Istio’s control plane can be used to specify declarative policies like those around circuit breaking, traffic routing, authentication/authorization, et. al. One important capability that Istio provides is ...

Read More »

It is never enough of them: enriching Apache Avro generated classes with custom Java annotations

Apache Avro, along with Apache Thrift and Protocol Buffers, is often being used as a platform-neutral extensible mechanism for serializing structured data. In the context of event-driven systems, the Apache Avro‘s schemas play the role of the language-agnostic contracts, shared between loosely-coupled components of the system, not necessarily written using the same programming language. Probably, the most widely adopted reference ...

Read More »

Mockito: Why You Still Should Appreciate InjectMocks Annotation

Anyone who has used Mockito for mocking and stubbing Java classes, probably is familiar with the InjectMocks-annotation. I seemed a little harsh in an article a few years back about why you should not use @InjectMocks to auto-wire fields, even though I actually consider Mockito to be one of the most brilliant mocking frameworks for unit testing in Java. Every ...

Read More »

Code-Based Test Automation vs. Codeless Automation

As more advanced technologies are entering the continuous testing landscape powered by AI/ML, organizations and especially, practitioners, are debating which is better, and why if any should they adopt codeless test authoring solutions? In this blog, I will be providing the various considerations to switch, and/or combine between the 2 test automation methods. TL,DR –> There isn’t a magic answer ...

Read More »