Giter Site home page Giter Site logo

insurance-rest-api's Introduction

#About this project.

Task:

Create rest api for insurance calculation depending on tariff, bonus, customer age and customer inception date.

Tech Stack:

  • Java 8
  • Maven
  • SpringBoot 2.1.7
  • H2
  • jUnit 5
  • Mockito
  • Swagger 2.7.0
  • Project Lombok
  • ValidationAPI
  • Log4j

Project structure.

Maven multi module project consisting of 3 parts:

  • “insurance-controller” main module with controllers, swagger and SpringBootApplication
  • “insurance-data” module related to database features
  • “insurance-engine” module related to final price calculation

How to Start

Requirements:

  • JDK 8
  • Preinstalled Maven 3+
  • Free port 8080

Steps:

  1. Execute command in the root folder: mvn clean package
  2. Go to {project_root_folder}/insurance-controller/target
  3. Execute command: java -jar insurance-controller-0.0.1-SNAPSHOT.jar
  4. Go to browser: http://localhost:8080/swagger-ui.html

How to use

There are 2 ways of project usage:

  1. Use swagger to explore all rest api methods. It contains documented information about required path parameters, fields and json bodies. Additionally, it is possible to execute all methods from swagger’s ui.
  2. Use Postman collection from the file: {project_root_folder}/notForBuild/Insurance Api.postman_collection.json

Logs

There will be file with logs when you start the application. It will be located in the {jar_folder}/logs/application.log. Try to get user with wrong id or create customer with date of birth in the future, then you will observe messages in the log file.

Docker

Docker may be used to test this application.

  • Build image command should be performed from {project_root_folder}/insurance-controller/target directory

Command: docker build -t insurance-app -f ../../notForBuild/Dockerfile .

  • Run docker image

Command: docker run -d -p 8080:8080 insurance-app

insurance-rest-api's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.