Java Assignment
Java Assignment
Objective: Build an insurance management platform that allows users to manage insurance
policies, clients, and claims using Spring Boot and Java.
Requirements:
1. Set up a new Spring Boot project using the Spring Initializr (https://start.spring.io/) and
select the necessary dependencies (e.g., Spring Web, Spring Data JPA, and an
embedded database like H2 or Apache Derby).
2. Create the necessary domain models and their relationships:
a. Client: Represents a client with properties such as name, date of birth, address,
and contact information.
b. InsurancePolicy: Represents an insurance policy with properties like policy
number, type, coverage amount, premium, start date, and end date. Each policy
should be associated with a client.
c. Claim: Represents an insurance claim with properties like claim number,
description, claim date, and claim status. Each claim should be associated with
an insurance policy.
3. Implement RESTful APIs for the following actions:
a. Clients:
i. GET /api/clients: Fetch all clients.
ii. GET /api/clients/{id}: Fetch a specific client by ID.
iii. POST /api/clients: Create a new client.
iv. PUT /api/clients/{id}: Update a client's information.
v. DELETE /api/clients/{id}: Delete a client.
b. Insurance Policies:
i. GET /api/policies: Fetch all insurance policies.
ii. GET /api/policies/{id}: Fetch a specific insurance policy by ID.
iii. POST /api/policies: Create a new insurance policy.
iv. PUT /api/policies/{id}: Update an insurance policy.
v. DELETE /api/policies/{id}: Delete an insurance policy.
c. Claims:
i. GET /api/claims: Fetch all claims.
ii. GET /api/claims/{id}: Fetch a specific claim by ID.
iii. POST /api/claims: Create a new claim.
iv. PUT /api/claims/{id}: Update a claim's information.
v. DELETE /api/claims/{id}: Delete a claim.
4. Use Spring Data JPA to create repositories for the domain models and interact with the
embedded database or mysql
5. Implement exception handling and validation to ensure proper API usage and data
integrity.
6. (Optional) Write unit tests for the APIs and services using JUnit and Mockito (or any
other preferred testing framework).
7. (Optional) Add basic authentication or JWT-based authentication to secure the APIs.
Deliverables:
1. A GitHub repository containing the source code for the insurance management platform.
2. A README file that explains how to run the application locally and includes a brief
description of the project, its structure, and its features.
Thanks,
Rachit