Skip to content
Open

🦂 #10

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
15eaca0
Set up packages, begin stubbing controllers
Apr 9, 2018
75d025a
Don't need an address controller
Apr 9, 2018
b64af20
Stub customer controller
Apr 9, 2018
32bbdca
refactor deleteAccountById, stub billsController
Apr 9, 2018
3293b9c
stub depositController
Apr 9, 2018
d668deb
Stub WithdrawalController
Apr 9, 2018
48255a3
Create entities
Apr 9, 2018
b249de1
Add UML diagram
Apr 9, 2018
2e70298
Account service demo
Apr 9, 2018
7f8c5fc
AccountController mappings, add path vars
Apr 9, 2018
a5e6324
CustomerController endpoints, param annots
Apr 9, 2018
3cb154e
BillController endpoints, param annots
Apr 9, 2018
802a360
DepositController endpoints, param annots
Apr 9, 2018
a57b81e
WithdrawalController endpoints, param annots
Apr 9, 2018
f9d48bd
Entity annotations
Apr 9, 2018
01d1c98
Add empty service Interfaces
Apr 9, 2018
9990d29
Create empty Service impls
Apr 9, 2018
d547e64
Create blank repositories
Apr 9, 2018
034b427
Autowire service impl repos
Apr 10, 2018
45e9c5a
Fill out service interfaces
Apr 10, 2018
7fc7922
Stub implementation methods
Apr 10, 2018
cc4432b
Connect controllers to service methods
Apr 10, 2018
580e41d
Create service test files
Apr 10, 2018
090af93
Account repo findAllByCustomerId
Apr 12, 2018
820986d
Add Bill repo query methods.
Apr 12, 2018
0f1dbeb
Add ManyToOne to accounts/customers
Apr 12, 2018
d7aaf86
AccountController status tests
Apr 12, 2018
80b4ee2
MockMvc shennanigans
Apr 12, 2018
4c42915
Refactor test setup
Apr 12, 2018
711664c
Write a test for billService.deleteById
Apr 12, 2018
0c1934f
Write remaining BillController tests
Apr 12, 2018
c959157
billController test refactor
Apr 12, 2018
641bf83
Refactor account controller tests
Apr 13, 2018
56a36c0
Suppress unchecked warnings for mocks
Apr 13, 2018
b768559
CustomerController tests, add deleteCustomer
Apr 13, 2018
6788745
Write DepositController tests
Apr 13, 2018
c032cc9
Add withdrawalId to withdrawal ctrl/interface
Apr 13, 2018
b6e6ca2
Create withdrawalController tests
Apr 13, 2018
7ffc30b
Bills service test POC, delete more expressive
Apr 13, 2018
3c29436
Test/impl billService methods
Apr 13, 2018
6c2038e
Write updateBill test, some refactoring
Apr 13, 2018
47917e6
Begin accountService testing, findByID done
Apr 13, 2018
06a11bb
refmt
Apr 13, 2018
e3fa311
AccountService findAccountByCustomerId
Apr 13, 2018
bc44f4c
Create new account
Apr 13, 2018
dd6fabc
Update account
Apr 13, 2018
0d9566f
Finish AccountServiceImpl
Apr 13, 2018
4dd539d
Change Deposit payee_id to account
Apr 13, 2018
4212255
Saving
CWinarski Apr 13, 2018
4212d3a
Saving
CWinarski Apr 13, 2018
e362c33
Test and impl find customer by account id
Apr 13, 2018
2f247e2
Test/impl find/save customers
Apr 13, 2018
afedeb0
Implement update Customer by customer id
Apr 13, 2018
8848101
Implement delete customer by Id
Apr 13, 2018
f533a6a
Switch to h2
Apr 13, 2018
4523d80
Add JAXB API dependencies
Apr 13, 2018
7ad5766
Set up AccountRepo test class
Apr 13, 2018
8acae49
Saving
CWinarski Apr 13, 2018
7e68604
Saving
CWinarski Apr 13, 2018
2a54625
Saving
CWinarski Apr 13, 2018
9dcc154
Saving
CWinarski Apr 13, 2018
64d1088
Rebase to origin/dev and reformat
Apr 13, 2018
d1930bd
Write and pass first repo test
Apr 13, 2018
22280f5
Checkout clean DepositServiceImplTest from master
Apr 13, 2018
26b22ba
Clean up AccountRepoTest, reformat src/
Apr 13, 2018
4eeceaf
BillRepo tests 50/50
Apr 13, 2018
8046964
Finished DepositServiceImpl and its tests
CWinarski Apr 14, 2018
dfde59c
Messing around inside domain classes [unstable]
Apr 14, 2018
49156aa
Fixed Conflicts and Finished Deposit Service Impl class and Tests
CWinarski Apr 14, 2018
efed16e
Fix BillRepo query, tests pass
Apr 14, 2018
e0bc5e4
Clean up BillRepo tests
Apr 14, 2018
c59f1e2
Merge pull request #1 from vvmk/dev
Apr 14, 2018
5d74ce4
BillRepo tests 50/50
Apr 13, 2018
041236d
Messing around inside domain classes [unstable]
Apr 14, 2018
cfe9b38
Fix BillRepo query, tests pass
Apr 14, 2018
10488bd
Clean up BillRepo tests
Apr 14, 2018
4be8fac
Merge branch 'repotests' into dev
Apr 14, 2018
5308ec9
Fix a typo
Apr 14, 2018
2158233
refmt
Apr 14, 2018
bad8370
Test findDepositByAccount_Id
Apr 14, 2018
3641fef
Write DepositRepo tests
Apr 14, 2018
bc97645
Merge branch 'dev'
Apr 14, 2018
dc2e2c1
Fix a conflict
Apr 13, 2018
c94e7a9
Fix withdrawalService method impl
Apr 13, 2018
f9dd273
Merge some jawns
Apr 13, 2018
41b987e
-_-
Apr 13, 2018
8441c81
first unit test working
Apr 13, 2018
1876830
second unit test is working
Apr 13, 2018
2ae7485
Adopt withdrawalsService tests
Apr 15, 2018
6c8b8ad
Complete WithdrawalService tests
Apr 15, 2018
f241b80
AccountController unit tests
Apr 15, 2018
3e9e0ee
Rename controller test classes
Apr 15, 2018
2a5467a
Customer controller unit tests
Apr 15, 2018
1e1ffa6
Bill controller unit tests
Apr 15, 2018
27fc2ce
Deposit controller unit tests
Apr 15, 2018
7672b8a
Withdrawal controller unit tests
Apr 15, 2018
cc08fda
Test Address repository
Apr 15, 2018
f8eac3e
refmt
Apr 15, 2018
8489415
Add RunWith
Apr 15, 2018
44196fc
Update gitignore
Apr 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ Temporary Items
.mvn/*
mvnw*
#maven build target
target/
target/
28 changes: 22 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<version>2.0.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.7</java.version>
<java.version>9</java.version>
</properties>

<dependencies>
Expand All @@ -39,16 +39,32 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Java 6 = JAX-B Version 2.0 -->
<!-- Java 7 = JAX-B Version 2.2.3 -->
<!-- Java 8 = JAX-B Version 2.2.8 -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
</dependencies>

<build>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/zipcoder/ZcwbankApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@SpringBootApplication
public class ZcwbankApplication {

public static void main(String[] args) {
SpringApplication.run(ZcwbankApplication.class, args);
}
public static void main(String[] args) {
SpringApplication.run(ZcwbankApplication.class, args);
}
}
58 changes: 58 additions & 0 deletions src/main/java/io/zipcoder/controller/AccountController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package io.zipcoder.controller;

import io.zipcoder.domain.Account;
import io.zipcoder.service.interfaces.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.*;

/**
* project: zcwbank
* package: io.zipcoder.controller
* author: https://github.com/vvmk
* date: 4/9/18
*/
@RestController
public class AccountController {
private AccountService accountService;

@Autowired
public AccountController(AccountService accountService) {
this.accountService = accountService;
}

@RequestMapping(value = "/accounts", method = GET)
public ResponseEntity<Iterable<Account>> getAllAccounts() {
return accountService.getAllAccounts();
}

@RequestMapping(value = "/accounts/{accountId}", method = GET)
public ResponseEntity<Account> getAccountById(@PathVariable("accountId") Long accountId) {
return accountService.getAccountById(accountId);
}

@RequestMapping(value = "/customers/{customerId}/accounts", method = GET)
public ResponseEntity<Iterable<Account>> getAccountsByCustomerId(@PathVariable("customerId") Long customerId) {
return accountService.getAccountsByCustomerId(customerId);
}

@RequestMapping(value = "/customers/{customerId}/accounts", method = POST)
public ResponseEntity<Account> createAccount(@RequestBody Account account, @PathVariable("customerId") Long customerId) {
return accountService.createAccount(account, customerId);
}

@RequestMapping(value = "/accounts/{accountId}", method = PUT)
public ResponseEntity<Account> updateAccount(@RequestBody Account account, @PathVariable("accountId") Long accountId) {
return accountService.updateAccount(account, accountId);
}

@RequestMapping(value = "/accounts/{accountId}", method = DELETE)
public ResponseEntity deleteAccountById(@PathVariable("accountId") Long accountId) {
return accountService.deleteAccountById(accountId);
}
}
57 changes: 57 additions & 0 deletions src/main/java/io/zipcoder/controller/BillController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package io.zipcoder.controller;

import io.zipcoder.domain.Bill;
import io.zipcoder.service.interfaces.BillService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.*;

/**
* project: zcwbank
* package: io.zipcoder.controller
* author: https://github.com/vvmk
* date: 4/9/18
*/
@RestController
public class BillController {

private BillService billService;

public BillController(BillService billService) {
this.billService = billService;
}

@RequestMapping(value = "/accounts/{accountId}/bills", method = GET)
public ResponseEntity<Iterable<Bill>> getBillsByAccountId(@PathVariable("accountId") Long accountId) {
return billService.getBillsByAccountId(accountId);
}

@RequestMapping(value = "/bills/{billId}", method = GET)
public ResponseEntity<Bill> getBillById(@PathVariable("billId") Long billId) {
return billService.getBillById(billId);
}

@RequestMapping(value = "/customers/{customerId}/bills", method = GET)
public ResponseEntity<Iterable<Bill>> getBillsByCustomerId(@PathVariable("customerId") Long customerId) {
return billService.getBillsByCustomerId(customerId);
}

@RequestMapping(value = "/accounts/{accountId}/bills", method = POST)
public ResponseEntity<Bill> createBill(@RequestBody Bill bill, @PathVariable("accountId") Long accountId) {
return billService.createBill(bill, accountId);
}

@RequestMapping(value = "/bills/{billId}", method = PUT)
public ResponseEntity<Bill> updateBill(@RequestBody Bill bill, @PathVariable("billId") Long billId) {
return billService.updateBill(bill, billId);
}

@RequestMapping(value = "/bills/{billId}", method = DELETE)
public ResponseEntity deleteBillById(@PathVariable("billId") Long billId) {
return billService.deleteBillById(billId);
}
}
60 changes: 60 additions & 0 deletions src/main/java/io/zipcoder/controller/CustomerController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package io.zipcoder.controller;

import io.zipcoder.domain.Customer;
import io.zipcoder.service.interfaces.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.*;

/**
* project: zcwbank
* package: io.zipcoder.controller
* author: https://github.com/vvmk
* date: 4/9/18
*/

@RestController
public class CustomerController {

private CustomerService customerService;

@Autowired
public CustomerController(CustomerService customerService) {
this.customerService = customerService;
}

@RequestMapping(value = "/accounts/{accountId}/customer", method = GET)
public ResponseEntity<Customer> getCustomerByAccountId(@PathVariable("accountId") Long accountId) {
return customerService.getCustomerByAccountId(accountId);
}

@RequestMapping(value = "/customers", method = GET)
public ResponseEntity<Iterable<Customer>> getAllCustomers() {
return customerService.getAllCustomers();
}

@RequestMapping(value = "/customers/{customerId}", method = GET)
public ResponseEntity<Customer> getCustomerById(@PathVariable("customerId") Long customerId) {
return customerService.getCustomerById(customerId);
}

@RequestMapping(value = "/customers", method = POST)
public ResponseEntity<Customer> createCustomer(@RequestBody Customer customer) {
return customerService.createCustomer(customer);
}

@RequestMapping(value = "/customers/{customerId}", method = PUT)
public ResponseEntity<Customer> updateCustomer(@RequestBody Customer customer, @PathVariable("customerId") Long customerId) {
return customerService.updateCustomer(customer, customerId);
}

@RequestMapping(value = "/customers/{customerId}", method = DELETE)
public ResponseEntity deleteCustomer(@PathVariable("customerId") Long customerId) {
return customerService.deleteCustomerById(customerId);
}
}
52 changes: 52 additions & 0 deletions src/main/java/io/zipcoder/controller/DepositController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package io.zipcoder.controller;

import io.zipcoder.domain.Deposit;
import io.zipcoder.service.interfaces.DepositService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.*;

/**
* project: zcwbank
* package: io.zipcoder.controller
* author: https://github.com/vvmk
* date: 4/9/18
*/
@RestController
public class DepositController {

private DepositService depositService;

public DepositController(DepositService depositService) {
this.depositService = depositService;
}

@RequestMapping(value = "/accounts/{accountId}/deposits", method = GET)
public ResponseEntity<Iterable<Deposit>> getAllDepositsByAccountId(@PathVariable("accountId") Long accountId) {
return depositService.getAllDepositsByAccountId(accountId);
}

@RequestMapping(value = "/deposits/{depositId}", method = GET)
public ResponseEntity<Deposit> getDepositById(@PathVariable("depositId") Long depositId) {
return depositService.getDepositById(depositId);
}

@RequestMapping(value = "/accounts/{accountId}/deposits", method = POST)
public ResponseEntity<Deposit> createDeposit(@RequestBody Deposit deposit, @PathVariable("accountId") Long accountId) {
return depositService.createDeposit(deposit, accountId);
}

@RequestMapping(value = "/deposits/{depositId}", method = PUT)
public ResponseEntity<Deposit> updateDeposit(@RequestBody Deposit deposit, @PathVariable("depositId") Long depositId) {
return depositService.updateDeposit(deposit, depositId);
}

@RequestMapping(value = "/deposits/{depositId}", method = DELETE)
public ResponseEntity deleteDepositById(@PathVariable("depositId") Long depositId) {
return depositService.deleteDepositById(depositId);
}
}
53 changes: 53 additions & 0 deletions src/main/java/io/zipcoder/controller/WithdrawalController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package io.zipcoder.controller;

import io.zipcoder.domain.Withdrawal;
import io.zipcoder.service.interfaces.WithdrawalService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.*;

/**
* project: zcwbank
* package: io.zipcoder.controller
* author: https://github.com/vvmk
* date: 4/9/18
*/

@RestController
public class WithdrawalController {

private WithdrawalService withdrawalService;

public WithdrawalController(WithdrawalService withdrawalService) {
this.withdrawalService = withdrawalService;
}

@RequestMapping(value = "/accounts/{accountId}/withdrawals", method = GET)
public ResponseEntity<Iterable<Withdrawal>> getAllWithdrawalsByAccountId(@PathVariable("accountId") Long accountId) {
return withdrawalService.getAllWithdrawalsByAccountId(accountId);
}

@RequestMapping(value = "/withdrawals/{withdrawalId}", method = GET)
public ResponseEntity<Withdrawal> getWithdrawalById(@PathVariable("withdrawalId") Long withdrawalId) {
return withdrawalService.getWithdrawalById(withdrawalId);
}

@RequestMapping(value = "/accounts/{accountId}/withdrawal", method = POST)
public ResponseEntity<Withdrawal> createWithdrawal(@RequestBody Withdrawal withdrawal, @PathVariable("accountId") Long accountId) {
return withdrawalService.createWithdrawal(withdrawal, accountId);
}

@RequestMapping(value = "/withdrawals/{withdrawalId}", method = PUT)
public ResponseEntity<Withdrawal> updateWithdrawal(@RequestBody Withdrawal withdrawal, @PathVariable("withdrawalId") Long withdrawalId) {
return withdrawalService.updateWithdrawal(withdrawal, withdrawalId);
}

@RequestMapping(value = "/withdrawals/{withdrawalId}", method = DELETE)
public ResponseEntity deleteWithdrawalById(@PathVariable("withdrawalId") Long withdrawalId) {
return withdrawalService.deleteWithdrawalById(withdrawalId);
}
}
Loading