@Test void generateConsents_couldNotParseData() { when(parseService.getDataFromFile(any(), any())).thenReturn(Optional.empty()); assertThrows(TppException.class, () -> tppConsentController.generateConsents(resolveMultipartFile(FILE_NAME))); }
@Override public ResponseEntity<List<String>> generateConsents(MultipartFile file) { log.info("Update file received"); List<AisConsent> parsed = parseService.getDataFromFile(file, new TypeReference<List<AisConsent>>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); return ResponseEntity.ok(tppConsentService.generateConsents(parsed)); }
TppConsentController implements TppConsentRestApi { @Override public ResponseEntity<List<String>> generateConsents(MultipartFile file) { log.info("Update file received"); List<AisConsent> parsed = parseService.getDataFromFile(file, new TypeReference<List<AisConsent>>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); return ResponseEntity.ok(tppConsentService.generateConsents(parsed)); } }
TppConsentController implements TppConsentRestApi { @Override public ResponseEntity<List<String>> generateConsents(MultipartFile file) { log.info("Update file received"); List<AisConsent> parsed = parseService.getDataFromFile(file, new TypeReference<List<AisConsent>>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); return ResponseEntity.ok(tppConsentService.generateConsents(parsed)); }  }
TppConsentController implements TppConsentRestApi { @Override public ResponseEntity<List<String>> generateConsents(MultipartFile file) { log.info("Update file received"); List<AisConsent> parsed = parseService.getDataFromFile(file, new TypeReference<List<AisConsent>>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); return ResponseEntity.ok(tppConsentService.generateConsents(parsed)); }  @Override ResponseEntity<List<String>> generateConsents(MultipartFile file); @Override ResponseEntity<Resource> downloadConsentTemplate(); }
TppConsentController implements TppConsentRestApi { @Override public ResponseEntity<List<String>> generateConsents(MultipartFile file) { log.info("Update file received"); List<AisConsent> parsed = parseService.getDataFromFile(file, new TypeReference<List<AisConsent>>() { }).orElseThrow(() -> new TppException("Could not parse data", 400)); return ResponseEntity.ok(tppConsentService.generateConsents(parsed)); }  @Override ResponseEntity<List<String>> generateConsents(MultipartFile file); @Override ResponseEntity<Resource> downloadConsentTemplate();  }