An exercise task to develop a simple search engine using Java with Spring Boot
This version is using the H2 in-memory database.
Clone from github:
> git clone https://github.com/basefx/jett.git
> cd jett
- Java 8
- Maven 3
Fast build:
> mvn package -DskipTests=true
The result should be:
[INFO] Reactor Summary:
[INFO]
[INFO] Java Engineer Test Task - Parent ................... SUCCESS [ 1.419 s]
[INFO] Java Engineer Test Task - Server ................... SUCCESS [ 2.844 s]
[INFO] Java Engineer Test Task - Client ................... SUCCESS [ 0.714 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.451 s
To run test:
> mvn test jacoco:report
A report could be found in the module target folders:
client/target/site/jacoco/index.html
server/target/site/jacoco/index.html
The project contains two types of tests:
- Unit tests with MockitoJUnitRunner e.g.
SearchServiceImplTest
ClientServiceImplTest
- End to end tests with SpringRunner e.g.
ServerEndToEndTest
ClientEndToEndTest
java -jar server/target/server-1.0-SNAPSHOT.jar
Recommended to run it in a separate console
A web client is implemented using SpringFox library to automate API UI creation
If server runs successfully click the following link to open Swagger UI http://localhost:8080/swagger-ui.html
API UI Screenshot:
java -jar client/target/client-1.0-SNAPSHOT.jar
Type command add press enter.
Type document with space separated tokens and press enter
The server responded with created document id:
Id: 6
Type command search press enter.
Enter Command (add, get, search, end)
search
Type a desired tokens space separated
Enter search string
lorem ipsum
Server responded with result
Document: [1,5]
Where numbers are document ids with all tokens
Type command end press enter.
- Yevgen Dovgopolyy - All the work - basefx
- All commands are given for unix-like systems


