- Account Information (e.g. how many accounts, account numbers, etc)
- Balance Check (e.g. remain balance, available balance, etc)
- Authentication (e.g. password check / reset, etc)
- Money Transfer(e.g. inter-account transfer, third-party transfer, etc)
- Settings (e.g. transfer limit, overseas withdraw limit, etc)
- Maven
- MySQL
- Docker (For SQL and server setup without above dependencies)
- Install dependencies
- Connect to MySQL server
-
Create database by
CREATE DATABASE oopasgdb;
-
Grant user:password to access MySQL database by
CREATE USER testAdmin@localhost IDENTIFIED BY 'password1'; GRANT ALL PRIVILEGES ON oopasgdb.* TO testAdmin@localhost;
-
Create transactions table by
use oopasgdb;
andCREATE TABLE `transactions` ( `transactionId` varchar(8) NOT NULL, `accountNumber` varchar(50) NOT NULL, `transactionDate` date NOT NULL, `transactionDetails` varchar(100) DEFAULT NULL, `chqNumber` varchar(50) DEFAULT NULL, `valueDate` date NOT NULL, `withdrawal` decimal(15,2) DEFAULT NULL, `deposit` decimal(15,2) DEFAULT NULL, `balance` decimal(15,2) NOT NULL, PRIMARY KEY (`transactionId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-
Create accounts table
CREATE TABLE `accounts` ( `CardNumber` BIGINT(20) NOT NULL, `AccountNumber` BIGINT(20) NOT NULL, `UserName` VARCHAR(45) NOT NULL, `Password` VARCHAR(128) NOT NULL, `FirstName` VARCHAR(45) NOT NULL, `LastName` VARCHAR(45) NOT NULL, `PasswordSalt` VARBINARY(128) NOT NULL, `AvailableBalance` FLOAT(45) NOT NULL, `TotalBalance` FLOAT(45) NOT NULL, `TransferLimit` FLOAT(45) NOT NULL, `IsAdmin` SMALLINT(1) NOT NULL, PRIMARY KEY (`AccountNumber`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Ensure port 3306 is unused
- Start sql and server docker containers
> ./start.sh
- Run client script
> make build
> make run
- Stop docker containers once done
> ./stop.sh
Ensure port 3306 is unused
- Start sql docker container
> docker-compose --profile=sql up -d
- Run server.java
- Stop docker container once done
> docker-compose --profile=sql down
- Run standalone test
> cd atm
> mvn test
- During build time
Tests will automatically run during build time