Commit 13c9d3f9 authored by Jürgen Hannus's avatar Jürgen Hannus
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Jürgen Hannus

See merge request teis/common-api-gateway!188
parents ef1261f5 d306ae3f
......@@ -11,39 +11,39 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class LocationControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(randomUUID().toString()).build();
@Autowired
LocationController controller;
@Test
void create_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.create(new LocationDto(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.create(new LocationDto(), REQUEST_META_DTO));
}
@Test
void delete_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.delete(randomUUID(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.delete(randomUUID(), REQUEST_META_DTO));
}
@Test
void getLocation_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getLocation(randomUUID(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getLocation(randomUUID(), REQUEST_META_DTO));
}
@Test
void getLocations_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getLocations(randomUUID(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getLocations(randomUUID(), REQUEST_META_DTO));
}
@Test
void update_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.update(randomUUID(), new LocationDto(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.update(randomUUID(), new LocationDto(), REQUEST_META_DTO));
}
@Test
void createLocationsFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.createLocationsFromTor(randomUUID(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.createLocationsFromTor(randomUUID(), REQUEST_META_DTO));
}
}
......@@ -13,24 +13,24 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class PersonControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
PersonController controller;
@Test
void getPerson_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getPerson("id", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getPerson("id", REQUEST_META_DTO));
}
@Test
void getPersons_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getPersons(PersonSearchFilterDto.builder().build(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getPersons(PersonSearchFilterDto.builder().build(), REQUEST_META_DTO));
}
@Test
void createPerson_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.createPerson(PersonDto.builder().build(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.createPerson(PersonDto.builder().build(), REQUEST_META_DTO));
}
}
......@@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class PersonTestControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
PersonTestController controller;
......@@ -21,7 +21,7 @@ class PersonTestControllerTest extends CommonApiGatewayTestBase {
void updatePerson_test() {
assertThrows(
NoResponseFromRabbitException.class,
() -> controller.updatePerson(UUID.randomUUID().toString(), PersonDto.builder().build(), requestMetaDTO));
() -> controller.updatePerson(UUID.randomUUID().toString(), PersonDto.builder().build(), REQUEST_META_DTO));
}
}
......@@ -12,19 +12,19 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class ProceduralActControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
ProceduralActController controller;
@Test
void getProceduralActs_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getProceduralActs("id", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getProceduralActs("id", REQUEST_META_DTO));
}
@Test
void getProceduralAct_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getProceduralAct("id", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getProceduralAct("id", REQUEST_META_DTO));
}
}
......@@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class RepresentativeControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(randomUUID().toString()).build();
@Autowired
RepresentativeController controller;
......@@ -20,49 +20,49 @@ class RepresentativeControllerTest extends CommonApiGatewayTestBase {
@Test
void checkRepresentative_test() {
assertThrows(NoResponseFromRabbitException.class,
() -> controller.checkRepresentative(randomUUID(), requestMetaDTO));
() -> controller.checkRepresentative(randomUUID(), REQUEST_META_DTO));
}
@Test
void delete_test() {
assertThrows(NoResponseFromRabbitException.class,
() -> controller.delete(randomUUID(), requestMetaDTO));
() -> controller.delete(randomUUID(), REQUEST_META_DTO));
}
@Test
void create_test() {
assertThrows(NoResponseFromRabbitException.class,
() -> controller.create(RepresentativeDto.builder().build(), requestMetaDTO));
() -> controller.create(RepresentativeDto.builder().build(), REQUEST_META_DTO));
}
@Test
void getRepresentative_test() {
assertThrows(NoResponseFromRabbitException.class,
() -> controller.getRepresentative(randomUUID(), requestMetaDTO));
() -> controller.getRepresentative(randomUUID(), REQUEST_META_DTO));
}
@Test
void getRepresentatives_test() {
assertThrows(NoResponseFromRabbitException.class,
() -> controller.getRepresentatives(RepresentativeSearchFilterDto.builder().build(), requestMetaDTO));
() -> controller.getRepresentatives(RepresentativeSearchFilterDto.builder().build(), REQUEST_META_DTO));
}
@Test
void getRepresentativesLastContact_test() {
assertThrows(NoResponseFromRabbitException.class,
() -> controller.getRepresentativesLastContact(randomUUID(), randomUUID(), requestMetaDTO));
() -> controller.getRepresentativesLastContact(randomUUID(), randomUUID(), REQUEST_META_DTO));
}
@Test
void update_test() {
assertThrows(NoResponseFromRabbitException.class, () ->
controller.updateRepresentative(randomUUID().toString(), RepresentativeDto.builder().build(), requestMetaDTO));
controller.updateRepresentative(randomUUID().toString(), RepresentativeDto.builder().build(), REQUEST_META_DTO));
}
@Test
void updateContacts_test() {
assertThrows(NoResponseFromRabbitException.class, () ->
controller.updateContacts(randomUUID(), new ContactInfoDto(), requestMetaDTO));
controller.updateContacts(randomUUID(), new ContactInfoDto(), REQUEST_META_DTO));
}
}
......@@ -13,24 +13,24 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class RoleControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(randomUUID().toString()).build();
@Autowired
RoleController controller;
@Test
void getPrivileges_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getPrivileges(List.of(randomUUID()), true, requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getPrivileges(List.of(randomUUID()), true, REQUEST_META_DTO));
}
@Test
void getRole_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRole(randomUUID(), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRole(randomUUID(), REQUEST_META_DTO));
}
@Test
void getRoles_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRoles("code", "type", "status", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRoles("code", "type", "status", REQUEST_META_DTO));
}
}
......@@ -13,19 +13,19 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class RoleTestControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(randomUUID().toString()).build();
@Autowired
RoleTestController controller;
@Test
void getPrivileges_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getPrivileges(List.of(randomUUID()), true, requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getPrivileges(List.of(randomUUID()), true, REQUEST_META_DTO));
}
@Test
void getRoles_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRoles("", "", "", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRoles("", "", "", REQUEST_META_DTO));
}
}
......@@ -13,18 +13,18 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class XroadArControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
XroadArController controller;
@Test
void getCompanyFromAR_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getCompanyFromAR("name", BigInteger.valueOf(999), requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getCompanyFromAR("name", BigInteger.valueOf(999), REQUEST_META_DTO));
}
@Test
void getCompanyRepresentativesFromAR_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getCompanyRepresentativesFromAR("id", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getCompanyRepresentativesFromAR("id", REQUEST_META_DTO));
}
}
......@@ -12,14 +12,14 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class XroadArTestControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
XroadArTestController controller;
@Test
void getRepresentationsFromAR_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRepresentationsFromAR("id", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRepresentationsFromAR("id", REQUEST_META_DTO));
}
}
......@@ -12,24 +12,24 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class XroadCacheTestControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
XroadCacheTestController controller;
@Test
void getXroadCacheObjectById_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getXroadCacheObjectById("name", "id", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getXroadCacheObjectById("name", "id", REQUEST_META_DTO));
}
@Test
void createXroadCacheObjects_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.createXroadCacheObjects("name", "id", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.createXroadCacheObjects("name", "id", REQUEST_META_DTO));
}
@Test
void deleteXroadCacheObject_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.deleteXroadCacheObject("name", "id", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.deleteXroadCacheObject("name", "id", REQUEST_META_DTO));
}
}
......@@ -12,19 +12,19 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class XroadEmtakTestControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
XroadEmtakTestController controller;
@Test
void getEmtakChanges_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmtakChanges(null, null, requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmtakChanges(null, null, REQUEST_META_DTO));
}
@Test
void getEmtakItems_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmtakItems(requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmtakItems(REQUEST_META_DTO));
}
}
......@@ -12,13 +12,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class XroadTorControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
XroadTorController controller;
@Test
void getEmployeesFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmployeesFromTor("emplId", requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmployeesFromTor("emplId", REQUEST_META_DTO));
}
}
......@@ -13,24 +13,24 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class XroadTorTestControllerTest extends CommonApiGatewayTestBase {
private static final String EMPL_ID_PARAMETER = "emplId";
private static final RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
XroadTorTestController controller;
@Test
void geNumberOfEmployeesFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.geNumberOfEmployeesFromTor(EMPL_ID_PARAMETER, requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.geNumberOfEmployeesFromTor(EMPL_ID_PARAMETER, REQUEST_META_DTO));
}
@Test
void getEmployersFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmployersFromTor(EMPL_ID_PARAMETER, requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmployersFromTor(EMPL_ID_PARAMETER, REQUEST_META_DTO));
}
@Test
void getLocationsFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getLocationsFromTor(EMPL_ID_PARAMETER, requestMetaDTO));
assertThrows(NoResponseFromRabbitException.class, () -> controller.getLocationsFromTor(EMPL_ID_PARAMETER, REQUEST_META_DTO));
}
}
......@@ -4,12 +4,13 @@ spring:
rabbitmq:
template:
reply-timeout: 500 # Timeout for `sendAndReceive()` operations.
minio:
url: https://minio.teis-s3:9000
access-key: teis
secret-key: zvFOY,u8KJrM;0dK/TcVbn
bucket: teis
teis:
file:
storage:
url: http://localhost:9000
access-key: miniotest
secret-key: miniosecret
mockauth:
token-secret: m4evcu4QkUq5v8f9JQs4mq8uRgbsBdDHKKcWs97gpf5hUrXWyQCbENgRE2zFR3P5VY9M6ddkY6Wmjspek6TrG7FP2ySaWZh633w
auth-user-info-api:
......
package ee.sm.ti.teis.commongateway.auditlog;
import ee.sm.ti.teis.commongateway.auditlog.dto.EmployerAuditLogItemSearchDto;
import ee.sm.ti.teis.commongateway.auditlog.dto.EmployerAuditLogItemsDto;
import ee.sm.ti.teis.commongateway.auditlog.request.EmployerAuditLogItemsRequest;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("auditlogs")
@RequiredArgsConstructor
public class AuditLogController extends TeisBaseController {
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.get-employer-audit-log}", response = EmployerAuditLogItemsDto.class)
@GetMapping("employer")
public EmployerAuditLogItemsDto getEmployerAuditLogItems(EmployerAuditLogItemSearchDto searchDto,
RequestMetaDTO requestMetaDTO) {
EmployerAuditLogItemsRequest request = new EmployerAuditLogItemsRequest();
request.setPayload(searchDto, requestMetaDTO);
return (EmployerAuditLogItemsDto) service.sendAndReceive(request);
}
}
......@@ -10,8 +10,6 @@ import ee.sm.ti.teis.commongateway.auditlog.request.CreateAuditLogItemRequest;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Profile;
......@@ -37,10 +35,6 @@ public class AuditLogTestController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.messages.get-audit-log}", response = AuditLogItemDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "parentDataObjectId", value = "${teis.api.messages.get-auditlog-parentObjectId}"),
@ApiImplicitParam(name = "dataObjectId", value = "${teis.api.messages.get-auditlog-dataObjectId}")
})
@GetMapping
public List<AuditLogItemDto> getAuditLogItems(
@RequestParam(name = "parentDataObjectId", required = false) String parentObjectId,
......
package ee.sm.ti.teis.commongateway.authorities.authoritylicence;
import ee.sm.ti.teis.commongateway.authorities.authoritylicence.dto.AuthorityLicenceDto;
import ee.sm.ti.teis.commongateway.authorities.authoritylicence.request.AuthorityLicencesRequest;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.types.enums.AuthorityLicenceType;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.UUID;
@RestController
@RequestMapping("authorities/authority-licences")
@RequiredArgsConstructor
public class AuthorityLicenceController extends TeisBaseController {
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.authorities.get-authority-licences}", response = AuthorityLicenceDto.class)
@GetMapping
public List<AuthorityLicenceDto> getAuthorityLicenses(@RequestParam UUID authorityId,
@RequestParam(required = false) AuthorityLicenceType licenceType,
@RequestParam(required = false) Boolean includeAll,
RequestMetaDTO requestMetaDTO) {
AuthorityLicencesRequest request = new AuthorityLicencesRequest();
request.setPayload(new AuthorityLicencesRequest.Parameters(authorityId, licenceType, includeAll), requestMetaDTO);
return (List<AuthorityLicenceDto>) service.sendAndReceive(request);
}
}
......@@ -4,12 +4,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
import ee.sm.ti.teis.exceptions.TeisBusinessException;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.exceptions.TeisRestException;
import ee.sm.ti.teis.fileclient.FileStorageServiceClient;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.types.enums.FileParameterType;
import io.minio.MinioClient;
import io.minio.errors.ErrorResponseException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.FileItemIterator;
......@@ -42,16 +40,14 @@ import static org.springframework.http.HttpStatus.PAYLOAD_TOO_LARGE;
@RequiredArgsConstructor
public class FileContentService {
private final MinioClient minioClient;
private final FileMetaProcessingService fileMetaProcessingService;
private final FileProcessingService fileProcessingService;
private final ParameterService parameterService;
private final ThumbnailService thumbnailService;
private final FileStorageServiceClient fileStorageServiceClient;
@Value("${teis.file.file-reference.update-timeout}")
private int fileReferenceUpdateTimeout;
@Value("${minio.bucket}")
private String bucketName;
@Value("${teis.file.upload.max-http-request-header-size}")
private int maxHttpRequestHeaderSize;
......@@ -62,9 +58,7 @@ public class FileContentService {
}
public FileReferenceDto saveFileToStorage(HttpServletRequest request, UUID objectId, FileObjectType objectType,
RequestMetaDTO requestMetaDTO) throws Exception {
validateCreateBucket();
RequestMetaDTO requestMetaDTO) throws Exception {
UUID fileId = UUID.randomUUID();
log.info("Generated file name to be saved to storage: {}", fileId);
......@@ -73,7 +67,7 @@ public class FileContentService {
try {
ServletFileUpload upload = new ServletFileUpload();
setMaxFileSize(objectType, requestMetaDTO, upload);
setMaxFileSize(objectType, upload, requestMetaDTO);
FileItemIterator iteratorStream;
try {
iteratorStream = upload.getItemIterator(request);
......@@ -88,6 +82,7 @@ public class FileContentService {
}
String fileName = null;
String contentType = null;
String bucket = null;
boolean fileExists = false;
while (iteratorStream.hasNext()) {
......@@ -103,7 +98,8 @@ public class FileContentService {
contentType = item.getContentType();
minioClient.putObject(bucketName, fileId.toString(), stream, null, null, null, contentType);