| 1 | package com.edtech.service; | |
| 2 | ||
| 3 | import java.util.UUID; | |
| 4 | import org.slf4j.Logger; | |
| 5 | import org.slf4j.LoggerFactory; | |
| 6 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | |
| 7 | import org.springframework.stereotype.Service; | |
| 8 | import org.springframework.web.multipart.MultipartFile; | |
| 9 | ||
| 10 | /** Documentação para LocalStorageServiceImpl. */ | |
| 11 | @Service | |
| 12 | @ConditionalOnProperty(name = "storage.provider", havingValue = "local") | |
| 13 | public class LocalStorageServiceImpl implements StorageService { | |
| 14 | private static final Logger log = LoggerFactory.getLogger(LocalStorageServiceImpl.class); | |
| 15 | ||
| 16 | @Override | |
| 17 | public void uploadFile(MultipartFile file, String fileKey, String contentType) throws Exception { | |
| 18 | log.info("Simulando upload local do arquivo {}", fileKey); | |
| 19 | } | |
| 20 | ||
| 21 | @Override | |
| 22 | public String getPresignedUrl(String fileKey) throws Exception { | |
| 23 |
1
1. getPresignedUrl : replaced return value with "" for com/edtech/service/LocalStorageServiceImpl::getPresignedUrl → NO_COVERAGE |
return "http://localhost:8080/local-storage-mock/" + fileKey + "?token=" + UUID.randomUUID(); |
| 24 | } | |
| 25 | ||
| 26 | @Override | |
| 27 | public void deleteFile(String fileKey) throws Exception { | |
| 28 | log.info("Simulando delete local do arquivo {}", fileKey); | |
| 29 | } | |
| 30 | } | |
Mutations | ||
| 23 |
1.1 |