Skip to content
Permalink
Browse files
returning teller after unlock
  • Loading branch information
mgeiss committed Jun 26, 2017
1 parent 71839a1 commit c536d8332bc2d099364289ce3ff00e349c1d79de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
@@ -128,7 +128,7 @@ TellerBalanceSheet getBalance(@PathVariable("officeIdentifier") final String off
@ThrowsException(status = HttpStatus.BAD_REQUEST, exception = TellerNotFoundException.class),
@ThrowsException(status = HttpStatus.CONFLICT, exception = TellerNotFoundException.class)
})
void unlockDrawer(@PathVariable("tellerCode") final String tellerCode,
Teller unlockDrawer(@PathVariable("tellerCode") final String tellerCode,
@RequestBody @Valid final UnlockDrawerCommand unlockDrawerCommand);

@RequestMapping(
@@ -44,7 +44,7 @@ public TestTellerOperation() {
}

@Test
public void shouldAuthenticate() throws Exception {
public void shouldUnlock() throws Exception {
final Teller teller = this.prepareTeller();

final UnlockDrawerCommand unlockDrawerCommand = new UnlockDrawerCommand();
@@ -56,7 +56,7 @@ public void shouldAuthenticate() throws Exception {


@Test(expected = TellerNotFoundException.class)
public void shouldNotAuthenticateUserMismatch() throws Exception {
public void shouldNotUnlockUserMismatch() throws Exception {
final Teller teller = this.prepareTeller();

final UnlockDrawerCommand unlockDrawerCommand = new UnlockDrawerCommand();
@@ -67,7 +67,7 @@ public void shouldNotAuthenticateUserMismatch() throws Exception {
}

@Test(expected = TellerNotFoundException.class)
public void shouldNotAuthenticatePasswordMismatch() throws Exception {
public void shouldNotUnlockPasswordMismatch() throws Exception {
final Teller teller = this.prepareTeller();

final UnlockDrawerCommand unlockDrawerCommand = new UnlockDrawerCommand();
@@ -83,7 +83,7 @@ public TellerOperationRestController(@Qualifier(ServiceConstants.LOGGER_NAME) fi
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseBody
ResponseEntity<Void> unlockDrawer(@PathVariable("tellerCode") final String tellerCode,
ResponseEntity<Teller> unlockDrawer(@PathVariable("tellerCode") final String tellerCode,
@RequestBody @Valid final UnlockDrawerCommand unlockDrawerCommand) {
final Teller teller = this.verifyTeller(tellerCode);

@@ -103,7 +103,7 @@ ResponseEntity<Void> unlockDrawer(@PathVariable("tellerCode") final String telle

this.logger.debug("Drawer {0} unlocked", unlockedTeller);

return ResponseEntity.ok().build();
return ResponseEntity.ok(teller);
} catch (final Exception e) {
throw ServiceException.notFound("Teller {0} not found.", teller.getCode());
}

0 comments on commit c536d83

Please sign in to comment.