Kotlin test

Adrien Carteron d4e633c815 [FEAT] use interface class by default, mpl is set usimg koin il y a 2 ans
Docker f5c782b392 [FEAT] add docker stuff to embed the service and the db il y a 2 ans
gradle f52351d6c3 first commit il y a 2 ans
src d4e633c815 [FEAT] use interface class by default, mpl is set usimg koin il y a 2 ans
.gitignore f52351d6c3 first commit il y a 2 ans
README.md 1ab7809b1d [FEAT] add readme il y a 2 ans
build.gradle.kts f52351d6c3 first commit il y a 2 ans
gradle.properties f52351d6c3 first commit il y a 2 ans
gradlew f52351d6c3 first commit il y a 2 ans
gradlew.bat f52351d6c3 first commit il y a 2 ans
settings.gradle.kts f52351d6c3 first commit il y a 2 ans
test.sh f52351d6c3 first commit il y a 2 ans

README.md

Implementation

Requirements

  • Gradle
  • Mongodb

Compile

gradle build

Run

unzip build/distributions/playerRank-0.0.1.zip -d <location>
/<location>/playerRank-0.0.1/bin/playerRank

starts web server with api: http://localhost:8080/

Run test

gradle test --tests "re.chasam.models.impl.TournamentImplTest"
gradle test --tests "re.chasam.models.impl.PlayerTest"

Mongo connexion

Its access follows the format:

scheme://host:port

to access to a db and use collection. Defaults parameters can be overriden using environments variables:

SCHEME
HOST
PORT
NAME
COLLECTION

Docker

cd Docker
docker compose up

API

GET /players

lists all players with name score and rank

GET /player/{id}

get a player score and its rank

POST /players {"name":"a name"}

add a new player, its score and rank are set to 0

PATCH /players/{id} {"score":42}

set the score of a player

DELETE /players

remove all players