|
14 | 14 | - [1.1 Unit Test](#11-unit-test) |
15 | 15 | - [1.2 Cucumber End to End Test](#12-cucumber-end-to-end-test) |
16 | 16 | - [1.3 Mutation Testing](#13-mutation-testing) |
| 17 | + - [1.4 Local Testing](#14-local-testing) |
17 | 18 | - [2. Development Accelerators](#2-development-accelerators) |
18 | 19 | - [2.1 Mapstruct](#21-mapstruct) |
19 | 20 | - [2.2 Lombok](#22-lombok) |
|
49 | 50 |
|
50 | 51 | ### Introduction |
51 | 52 |
|
52 | | -This project is intended to bring arguably best practices and integrations available for Spring Boot based Microservice |
53 | | -in a single repository. |
| 53 | +This repository combines the best practices and essential integrations for building robust Spring Boot-based microservices, all in one place. It serves as a template, allowing developers to easily create their own microservices by adding or removing dependencies based on their needs. |
54 | 54 |
|
55 | | -Developers can use this repository as a template to build there own Microservice by adding or removing dependencies as |
56 | | -per requirement. |
| 55 | +In the sections below, I'll walk you through the various integrations included in the project and guide you on how to use them effectively. |
57 | 56 |
|
58 | | -In the below section I will try to explain each integration we have made and how to use. |
59 | | - |
60 | | -At the moment the Microservice exposes a GET API and expects the company reference as path parameter then makes a call |
61 | | -to the Companies House API hence returning Company Details. |
62 | | - |
63 | | -**Note: Texts highlighted in light blue colour are clickable hyperlinks for additional references.** |
| 57 | +Currently, the microservice exposes a simple GET API that accepts a company reference as a path parameter. It then queries the Companies House API to retrieve and return detailed company information. |
64 | 58 |
|
65 | 59 | ### Prerequisites |
66 | 60 |
|
67 | 61 | - You must have >= Java 21 Installed. You can use [SDKMAN](https://sdkman.io/install) for maintaining different JDK's in your system. |
68 | | -- If you wish to run the application against the actual Companies House |
69 | | - API and then you will need to [create a free account](https://developer.companieshouse.gov.uk/developer/signin). |
70 | | - Once created replace the `authUserName` in the [application.yaml](src/main/resources/application.yaml) under main dir. |
| 62 | +- You should [register for a free Companies House account](https://developer.company-information.service.gov.uk/get-started) and then generate a REST API key. This is required for invoking the GET API exposed by this service else the API invocation will fail at runtime with auth error. |
| 63 | +- Replace the `authUserName` in the [application.yaml](src/main/resources/application.yaml) under main dir with the newly created API Key. |
71 | 64 |
|
72 | 65 | ### Installation and Getting Started |
73 | 66 |
|
@@ -172,6 +165,22 @@ once the test execution completes report should be accessible at: |
172 | 165 |
|
173 | 166 |  |
174 | 167 |
|
| 168 | +#### 1.4 Local Testing |
| 169 | + |
| 170 | +The application can be started in the IDE through [CompaniesHouseApplication.java](src/main/java/com/uk/companieshouse/CompaniesHouseApplication.java) or by executing below command in the terminal |
| 171 | + |
| 172 | +```bash |
| 173 | +./gradlew bootRun |
| 174 | +``` |
| 175 | + |
| 176 | +Once the application starts the application can be accessed through below URL: |
| 177 | + |
| 178 | +``` |
| 179 | +curl --location 'http://localhost:8080/companieshouse/search/abhishek' |
| 180 | +``` |
| 181 | + |
| 182 | +If valid Rest API Key is added in `authUserName` then we should receive all the companies details that has `abhishek` in their registered **title** |
| 183 | + |
175 | 184 | ### 2. Development Accelerators |
176 | 185 |
|
177 | 186 | #### [2.1 Mapstruct](https://mapstruct.org/) |
|
0 commit comments