@Test void downloadAccountTemplate() { when(downloadResourceService.getResourceByTemplate(any())).thenReturn(null); ResponseEntity<Resource> response = accountsController.downloadAccountTemplate(); assertThat(response.getStatusCode().is2xxSuccessful()).isTrue(); }
@Override public ResponseEntity<Resource> downloadAccountTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); }
TppAccountsController implements TppAccountsRestApi { @Override public ResponseEntity<Resource> downloadAccountTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); } }
TppAccountsController implements TppAccountsRestApi { @Override public ResponseEntity<Resource> downloadAccountTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); }  }
TppAccountsController implements TppAccountsRestApi { @Override public ResponseEntity<Resource> downloadAccountTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); }  @Override ResponseEntity<Void> createAccount(String userId, DepositAccount account); @Override ResponseEntity<Void> updateAccountAccess(AccountAccess accountAccess); @Override ResponseEntity<List<AccountDetailsTO>> getAllAccounts(); @Override ResponseEntity<CustomPageImpl<AccountDetailsTO>> getAllAccounts(String queryParam, int page, int size); @Override ResponseEntity<AccountDetailsTO> getAccountDetailsByIban(String iban); @Override ResponseEntity<AccountDetailsTO> getSingleAccount(String accountId); @Override ResponseEntity<AccountReport> accountReport(String accountId); @Override ResponseEntity<Void> depositCash(String accountId, AmountTO amount); @Override ResponseEntity<Resource> downloadAccountTemplate(); @Override ResponseEntity<Boolean> changeStatus(String accountId); }
TppAccountsController implements TppAccountsRestApi { @Override public ResponseEntity<Resource> downloadAccountTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); }  @Override ResponseEntity<Void> createAccount(String userId, DepositAccount account); @Override ResponseEntity<Void> updateAccountAccess(AccountAccess accountAccess); @Override ResponseEntity<List<AccountDetailsTO>> getAllAccounts(); @Override ResponseEntity<CustomPageImpl<AccountDetailsTO>> getAllAccounts(String queryParam, int page, int size); @Override ResponseEntity<AccountDetailsTO> getAccountDetailsByIban(String iban); @Override ResponseEntity<AccountDetailsTO> getSingleAccount(String accountId); @Override ResponseEntity<AccountReport> accountReport(String accountId); @Override ResponseEntity<Void> depositCash(String accountId, AmountTO amount); @Override ResponseEntity<Resource> downloadAccountTemplate(); @Override ResponseEntity<Boolean> changeStatus(String accountId);  }