Manage Bank Accounts. Simple Java project to show more about Test Driven Development and object oriented design, using:
- Java
- Ant
- Maven
- Spring Boot
- Heroku deploy
- More to come (ant + ivy / cpd / pmd / coverage / other test approaches / gradle option)
- To run tests: "ant test"
- download dependencies: "mvn install"
- run spring-boot API: "mvn spring-boot:run"
- Sample request:
- add Account: "/add?name=51987654321&balance=500"
- check balance: "/balance?name=51987654321"
- withdraw: "withdraw?name=51987654321&value=200"
- if using curl for testing, use something like "curl \ --data-urlencode "name=51987654321" \ --data-urlencode "value=500" \ http://localhost:8088/add"
- Default port is 8080. If you want to change, check resources/application.properties.
- Update yum and java and dependencies. Reference
- I'm using Amazon Linux, so:
- update packages: sudo yum -y update
- install java 8: sudo yum -y install java-1.8.0-openjdk-devel
- update java version used: sudo update-alternatives --config java
- update javac version used: sudo update-alternatives --config javac
- install maven:
- sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
- sudo sed -i s/$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
- sudo yum install -y apache-maven
- now you can run mvn install and mvn spring-boot:run
- I'm using Amazon Linux, so:
- Install Heroku Client on your setup.
- Create a new remote to heroku: "heroku create choose-a-project-name". This will create a choose-a-project-name.herokuapp.com so you can access your app after deployment. If you only use a "heroku create", Heroku will create a slick name for you.
- Send the project to heroku: "git push heroku master"
- If something is not right, check heroku logs, using "heroku logs --tail"
- You can test a sample using my install at https://bankaccount-travis.herokuapp.com