@Test void uploadData_couldNotParseData() { when(parseService.getDataFromFile(any(), any())).thenReturn(Optional.empty()); assertThrows(TppException.class, () -> uploaderController.uploadData(resolveMultipartFile("transactions_template.csv"))); }
@Override public ResponseEntity<String> uploadData(MultipartFile file) { log.info("Update file received"); DataPayload parsed = parseService.getDataFromFile(file, new TypeReference<DataPayload>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); restExecutionService.updateLedgers(parsed); return ResponseEntity.ok("Data successfully updated"); }
TppDataUploaderController implements TppDataUploaderRestApi { @Override public ResponseEntity<String> uploadData(MultipartFile file) { log.info("Update file received"); DataPayload parsed = parseService.getDataFromFile(file, new TypeReference<DataPayload>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); restExecutionService.updateLedgers(parsed); return ResponseEntity.ok("Data successfully updated"); } }
TppDataUploaderController implements TppDataUploaderRestApi { @Override public ResponseEntity<String> uploadData(MultipartFile file) { log.info("Update file received"); DataPayload parsed = parseService.getDataFromFile(file, new TypeReference<DataPayload>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); restExecutionService.updateLedgers(parsed); return ResponseEntity.ok("Data successfully updated"); }  }
TppDataUploaderController implements TppDataUploaderRestApi { @Override public ResponseEntity<String> uploadData(MultipartFile file) { log.info("Update file received"); DataPayload parsed = parseService.getDataFromFile(file, new TypeReference<DataPayload>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); restExecutionService.updateLedgers(parsed); return ResponseEntity.ok("Data successfully updated"); }  @Override ResponseEntity<String> uploadData(MultipartFile file); @Override ResponseEntity<Resource> generateData(boolean generatePayments, String currency); @Override ResponseEntity<String> generateIban(String tppId); @Override ResponseEntity<Map<String, String>> uploadTransactions(MultipartFile file); @Override ResponseEntity<Resource> downloadTransactionTemplate(); }
TppDataUploaderController implements TppDataUploaderRestApi { @Override public ResponseEntity<String> uploadData(MultipartFile file) { log.info("Update file received"); DataPayload parsed = parseService.getDataFromFile(file, new TypeReference<DataPayload>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); restExecutionService.updateLedgers(parsed); return ResponseEntity.ok("Data successfully updated"); }  @Override ResponseEntity<String> uploadData(MultipartFile file); @Override ResponseEntity<Resource> generateData(boolean generatePayments, String currency); @Override ResponseEntity<String> generateIban(String tppId); @Override ResponseEntity<Map<String, String>> uploadTransactions(MultipartFile file); @Override ResponseEntity<Resource> downloadTransactionTemplate();  }