@Test void downloadConsentTemplate() { when(downloadResourceService.getResourceByTemplate(any())).thenReturn(resourceLoader.getResource(FILE_NAME)); ResponseEntity<Resource> response = tppConsentController.downloadConsentTemplate(); assertThat(response.getStatusCode().is2xxSuccessful()).isTrue(); }
@Override public ResponseEntity<Resource> downloadConsentTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); }
TppConsentController implements TppConsentRestApi { @Override public ResponseEntity<Resource> downloadConsentTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); } }
TppConsentController implements TppConsentRestApi { @Override public ResponseEntity<Resource> downloadConsentTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); }  }
TppConsentController implements TppConsentRestApi { @Override public ResponseEntity<Resource> downloadConsentTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); }  @Override ResponseEntity<List<String>> generateConsents(MultipartFile file); @Override ResponseEntity<Resource> downloadConsentTemplate(); }
TppConsentController implements TppConsentRestApi { @Override public ResponseEntity<Resource> downloadConsentTemplate() { return ResponseEntity.ok() .contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + FILE_NAME) .body(downloadResourceService.getResourceByTemplate(FILE_NAME)); }  @Override ResponseEntity<List<String>> generateConsents(MultipartFile file); @Override ResponseEntity<Resource> downloadConsentTemplate();  }