Author: SFG Contributor

About SFG Contributor

Staff writer account for Spring Framework Guru

    In Relational Database Management Systems (RDBMS), a stored procedure is a batch of prepared SQL code grouped as a logical unit that you store in the database. Stored procedures allow reusability of SQL code. In this post, I will explain how to call MySQL stored procedures from a Spring Boot application. Dependency For the application […]Continue reading

    Data validation is a basic requirement for any application. This is more significant for web applications that accept data as input. Bean Validation or commonly known as JSR-380 is a Java standard that is used to perform validation in Java applications. To perform validation, data Items are applied constraints. As long as the data satisfies […]Continue reading

    The Spring framework has a library called Spring State Machine which is a model of computation that depends on the finite states. It can only be in one state at a given time, hence it is also called a finite state machine. The transitions of this State Machine are the changes in the status of […]Continue reading

    When you develop a Spring Bool RESTful service, you as a programmer are responsible for handling exceptions in the service. For instance, by properly handling exceptions, you can stop the disruption of the normal flow of the application. In addition, proper exception handling ensures that the code doesn’t break when an exception occurs. Another important […]Continue reading

    Java 8 introduces a new date and time API defined inside the java.time package. The key date and time classes defined in this package are LocalDateTime, ZonedDateTime, and OffsetDateTime. OffsetDateTime is an immutable representation of a date-time with an offset from UTC. It stores all date and time fields, to a precision of nanoseconds. For example, you can […]Continue reading

    Consider a scenario where a database query matches over 1000 records. You need to display the query results to users. In this scenario, you probably won’t want to display all records on a single page. Instead,  you would want to display chunks of data of suitable sizes with high readability. To achieve this, you use […]Continue reading

    When developing REST APIs, it is important to have accurate and well-structured documentation of your API. This documentation is the reference point for anyone who wants to use your API. Spring REST Docs helps you to achieve it. Spring REST Docs take a different approach than any other traditional tools like Swagger. For more information on […]Continue reading

    Parameterized tests in JUnit 5 enable you to run a test multiple times with different parameters. It helps the developers to save time in writing and executing the tests. We can write JUnit 5 parameterized tests just like regular JUnit 5 tests but have to use the @ParameterizedTest annotation instead. In a parameterized test, you […]Continue reading

    ArgumentCaptor in Mockito allows you to capture arguments passed to methods for further assertions. You can apply standard JUnit assertion methods, such as assertEquals(), assertThat(), and so on, to perform assertions on the captured arguments. In Mockito, you will find the ArgumentCaptor class in the org. mockito package If you are new to mocking with […]Continue reading

    Enterprise Applications developed using the Spring Framework use different types of configuration properties to configure the application at runtime. These configuration properties help in connecting to databases, messaging systems, perform logging, caching, and lots more. It is common to store configuration properties in external .properties and .yml files. There are various ways of reading external […]Continue reading