Simple Java app with Postgres database(via JDBC).
Simple Java + Postgresql (inside docker container) application, where you can search by names of customers and get some stats.
App can be run locally, requirements a listed below.
- Java8
- Docker
Build docker image
$ docker build -t test_task .
Start container with environment arguments.
$ docker run -d --name ai_test -p 5433:5432 -e POSTGRES_PASSWORD=qwerty -e POSTGRES_USER=postgres -e POSTGRES_DB=task test_task:latest
By default app works with POSTGRES_PASSWORD=qwerty, POSTGRES_USER=postgres and POSTGRES_DB=task.
Postgres database started on port 5432 (you can specify external port :)).
$ mvn clean package
$ java -jar target/TestTask-1.0-SNAPSHOT.jar search input.json output.json
or
$ java -jar target/TestTask-1.0-SNAPSHOT.jar stats input.json output.json
Some testcases are in src/main/resources/testcases directory. You can copy it into input.json and run it to see how app works. Result will be in output.json.