Skip to content

This is an example of how to build the "game" of war with a Jersey API and MongoDB db. This API is could be consumed by a UI. This app can be expanded to host other simple card games as well.

Notifications You must be signed in to change notification settings

lancempoe/GameOfWarJerseyMongoDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game of War

This is an example of how to build the "game" of war with a Jersey API and MongoDB db. This API is could be consumed by a UI.`` This app can be expanded to host other simple card games as well.

Here are the current endpoints:

URLs CRUD Description
http://localhost:8080/api/health GET Validates Health
http://localhost:8080/api/game/war?numberOfSuits={a}&numberOfRanks={b} POST Creates new game with {a} suits and {b} ranks, returns {id}
http://localhost:8080/api/game/war/play?numberOfSuits={a}&numberOfRanks={b} POST Simulates a complete game with {a} suits and {b} ranks. Returns results of the game.
http://localhost:8080/api/game/war/{id} GET Returns game {id}
http://localhost:8080/api/game/war/{id} DELETE Deletes game {id}
http://localhost:8080/api/game/war/{id}/draw POST Moves the game ahead by 1 draw (including all resulting wars). Returns current status of the game along with cards played in that draw.

I used the following:

  • Jersey 2
  • Spring 4
  • mongo-java-driver 2
  • spring-data-mongodb 1.2

In this project I also tested with difference frameworks

  • junit 4.10
  • JMockit 1.24
  • hamcrest 1.3

About

This is an example of how to build the "game" of war with a Jersey API and MongoDB db. This API is could be consumed by a UI. This app can be expanded to host other simple card games as well.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages