Skip to content

An application that demonstrates how to integrate Mockito in a Spring Boot REST API.

Notifications You must be signed in to change notification settings

czetsuya/test-speech-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

*If you would like to support these tutorials, you can contribute to my Patreon account

Speech Manager

This application provides speech management features:

  1. View all their speeches saved in the system.
  2. Add a speech to the system (for this challenge we will consider a speech to have the actual text, the author information, keywords about the speech and a speech date).
  3. Edit a speech or its metadata
  4. Delete a speech
  5. Share a speech with someone else via email
  6. The ability to search the speeches – (search by author, date range, subject area, or snippets of text from the speech body.

Tech

This project exposes REST API running on top of Spring Boot 2 framework. It integrates Mapstruct library for entity-dto conversion and Lombok for automatic getter/setter generation.

Deployment

To run the application, simply clone this project and execute the command below in the terminal inside the project's root directory.

mvn spring-boot:run

The application should be running on port 8080 by default.

Docker Container

Before building the docker container, make sure to build the project first by running mvn install.

To run the application and PostgreSQL in docker, open a command prompt and go to the project's root directory.

docker-compose up

Testing

The integration tests are created using Mockito and can be run via maven (development-h2 profile must be use):

mvn clean test -P development-h2

A Postman collection is also available in the test/postman folder. To run it, development profile must be use and a PostgreSQL database must be configured.

  • DatabaseName=legalsight
  • Username=dev
  • Password=dev

The test "Share speech will fail" as it requires a valid email account in the application.properties.

About

An application that demonstrates how to integrate Mockito in a Spring Boot REST API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published