DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library
Core Badge
Avatar

Seun Matt

DZone Core CORE

Engineering Manager at Cellulant

Lagos, NG

Joined Jul 2017

https://smattme.com

About

Tech Entrepreneur | Full Stack Software Developer. I write to let out my views, pass on my knowledge and remain creative.

Stats

Reputation: 507
Pageviews: 176.3K
Articles: 8
Comments: 9

Expertise

Deployment Expertise Icon

Deployment

  • Articles
  • Comments

Articles

article thumbnail
Want to Become a Senior Software Engineer? Do These Things
Practical, day-to-day steps you can take to become a Senior Software Engineer. Know the basics, deepen your knowledge, be proactive, and take responsibility.
June 13, 2025
· 4,239 Views · 4 Likes
article thumbnail
Configure Testcontainers in Spring Boot 3.x, 2.x, and Reactive
Testcontainers allows you to spin up lightweight, disposable containers for databases, messaging systems, and more, ensuring your tests are isolated and predictable
March 10, 2025
· 4,970 Views · 3 Likes
article thumbnail
Auto Deploy Spring Boot App Using GitLab CI/CD
Create a Spring Boot application, set up your server, and configure GitLab to build your app, run tests, and deploy automatically to your server.
Updated November 13, 2023
· 40,433 Views · 4 Likes
article thumbnail
How To Use Flyway for Database Migration in Spring Boot
In this article, take a look at how to use Flyway to manage a SQL database schema in a Spring Boot application.
August 8, 2023
· 17,508 Views · 3 Likes
article thumbnail
How To Validate JSON Request Body in Spring Boot
We will be looking at the request-validator library, which is able to compare the user input against a pre-defined set of rules like required, max, min, email, etc.
October 30, 2022
· 23,457 Views · 6 Likes
article thumbnail
Spring Boot Exception Handling
In this article, we are going to learn how to configure Spring Boot to handle exceptions, including custom ones, and customize the error responses and handling.
November 22, 2021
· 15,045 Views · 8 Likes
article thumbnail
How to Back Up a MySQL Database Programmatically Using mysql-backup4j
Interested in setting up programmatic backups for your MySQL DB? See how the mysql-backup4j library can let you do just that in Java.
March 23, 2018
· 27,394 Views · 7 Likes
article thumbnail
How to Create a Database Seeder in Spring Boot
Learn how to seed the database on application startup. Seeders can help you create default admin accounts or other default data required by your application.
July 22, 2017
· 34,941 Views · 8 Likes

Comments

How To Validate JSON Request Body in Spring Boot

Nov 03, 2022 · Seun Matt

"The static methods are hard to mock." - There's nothing to mock in this case. The request-validator library will be used in a service or a controller or even a utility class. What will be mocked is the library's caller and not the library itself. I also think we can all agree one's not expected to mock a controller.


What I mean by "when you want to apply more than one rule to the same field" is imagine a scenario where you need to ensure the email field is required, has a valid email address and is not longer than 200 characters. Each of these validations needs its own annotations on the same field.

However, with the request-validator, it's a matter of specifying the following: "required|email|max:250"


Another advantage of the library is that you can validate a field based on the input of another field in the same request. For example, let's say fieldA can either be COLOURS or PLANETS, then you can add another validation on fieldB such that if the value of fieldA is COLOURS, then fieldB should be present and among a list of COLOURS. This is achieved effortlessly with the library but with javax validation, you'll need to do some gymnastics.


Hope this helps, cheers.


How To Validate JSON Request Body in Spring Boot

Nov 02, 2022 · Seun Matt

For one, you don't have to create multiple DTOs or litter your code with annotations especially when you want to apply more than one rule to the same field.

In terms of testing, I don't see how it is "bad" for testing in the sense that, if you call the controller with the wrong input, you still get the errors. This applies when calling the controller via MockMvc or a full-blown HTTP request


How to Back Up a MySQL Database Programmatically Using mysql-backup4j

May 22, 2019 · Seun Matt

Hi Dhaval,

Currently, there's no way to specify a specific table(s) for backup. I'll suggest you create an issue that'll be labelled feature request or better still a PR.

Cheers.

How to Enable HTTP/HTTPS on Spring Boot [Snippet]

Mar 04, 2019 · Ganesh Sahu

For SpringBoot 2.0+ This is the equivalent code:

@Bean
public ServletWebServerFactory servletContainer(@Value("${http.port}") int httpPort) {

Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
connector.setPort(httpPort);

TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
tomcat.addAdditionalTomcatConnectors(connector);
return tomcat;

}


cheers

How to Back Up a MySQL Database Programmatically Using mysql-backup4j

Jan 28, 2019 · Seun Matt

Glad you can find a way out. However, were you able to get the reason it's unable to create temp dir? File Permission?

Microservices Design Patterns: Essential Architecture and Design Guide

Oct 24, 2018 · Rajesh Bhojwani

Great article! I currently used the shared database pattern to handle an application transitioning from monolith towards microservices.

How to Create a Database Seeder in Spring Boot

Jul 26, 2017 · Seun Matt

Though I haven't used Wildfly, my quick look up reveals that you are right. A simple jar file with just what it needs. Spring Boot uses embedded Tomcat by default but can also use embedded Jetty as an application server.

How to Create a Database Seeder in Spring Boot

Jul 26, 2017 · Seun Matt

That's great to hear!

How to Create a Database Seeder in Spring Boot

Jul 24, 2017 · Seun Matt

Jamie thanks for noting that.

The main advantage and reason why I use this method is to avoid writing SQL. I want to use existing models and ORM instead of writing too much raw SQL plus it's possible to add logic.

I have tried flyway although haven't tried liquidbase.

Summarily, the peculiarity of the technique is the ability to use existing models and repositories to persist data.


User has been successfully modified

Failed to modify user

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook