Commit 29e3c60a authored by Siiri Tann's avatar Siiri Tann
Browse files

Merge branch 'TEIS-2109-2' into 'develop'

TEIS-2109: improved integration tests.

Closes TEIS-2109

See merge request teis/common-api-gateway!214
parents b46f99e0 888ef18a
package ee.sm.ti.teis.commongateway.xroadgateway;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.math.BigInteger;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser
class XroadArControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final String BASE_URL = "/xroad/ar/";
@Autowired
XroadArController controller;
MockMvcUtil mockMvcUtil;
@Test
void getCompanyFromAR_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getCompanyFromAR("name", BigInteger.valueOf(999), REQUEST_META_DTO));
void getCompanyRepresentativesFromAR_success() {
when(requestProcessingService.sendAndReceive(any(ArRepresentativesXroadRequest.class)))
.thenReturn("test");
mockMvcUtil.testGet(BASE_URL + "company-representatives/" + randomUUID(), null, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(ArRepresentativesXroadRequest.class));
}
@Test
void getCompanyFromAR_success() {
when(requestProcessingService.sendAndReceive(any(ArCompanyXroadRequest.class)))
.thenReturn("test");
parameters.add("name", "test");
parameters.add("regCode", BigInteger.valueOf(999).toString());
mockMvcUtil.testGet(BASE_URL + "company", parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(ArCompanyXroadRequest.class));
}
@Test
void getCompanyRepresentativesFromAR_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getCompanyRepresentativesFromAR("id", REQUEST_META_DTO));
void getCompanyDetailsFromAr_success() {
when(requestProcessingService.sendAndReceive(any(ArCompanyDetailsXroadRequest.class)))
.thenReturn("{}");
parameters.add("id", randomUUID().toString());
mockMvcUtil.testGet(BASE_URL + "company-details/" + randomUUID(), parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(ArCompanyDetailsXroadRequest.class));
}
}
package ee.sm.ti.teis.commongateway.xroadgateway;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser
class XroadArTestControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
XroadArTestController controller;
MockMvcUtil mockMvcUtil;
@Test
void getRepresentationsFromAR_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getRepresentationsFromAR("id", REQUEST_META_DTO));
void getRepresentationsFromAR_success() {
when(requestProcessingService.sendAndReceive(any(ArRepresentationsXroadRequest.class)))
.thenReturn("test");
parameters.add("id", "id");
mockMvcUtil.testGet("/xroad/ar/company-representations/" + randomUUID(), parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(ArRepresentationsXroadRequest.class));
}
}
package ee.sm.ti.teis.commongateway.xroadgateway;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser
class XroadCacheTestControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final String BASE_URL = "/xroadgateway/cache/";
@Autowired
XroadCacheTestController controller;
MockMvcUtil mockMvcUtil;
@Test
void getXroadCacheObjectById_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getXroadCacheObjectById("name", "id", REQUEST_META_DTO));
void getXroadCacheObjectById_success() {
when(requestProcessingService.sendAndReceive(any(XroadGatewayCacheRequest.class)))
.thenReturn("{}");
parameters.add("id", "id");
mockMvcUtil.testGet(BASE_URL + "test", parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(XroadGatewayCacheRequest.class));
}
@Test
void createXroadCacheObjects_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.createXroadCacheObjects("name", "id", REQUEST_META_DTO));
void createXroadCacheObjects_success() {
when(requestProcessingService.sendAndReceive(any(UpdateXroadGatewayCacheRequest.class)))
.thenReturn("{}");
mockMvcUtil.testPost(BASE_URL + "test", new UpdateXroadGatewayCacheRequest.Parameters(), new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(UpdateXroadGatewayCacheRequest.class));
}
@Test
void deleteXroadCacheObject_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.deleteXroadCacheObject("name", "id", REQUEST_META_DTO));
void deleteXroadCacheObject_success() {
when(requestProcessingService.sendAndReceive(any(DeleteXroadGatewayCacheRequest.class)))
.thenReturn("{}");
parameters.add("id", "test");
mockMvcUtil.testDelete(BASE_URL + "name?id=id");
verify(requestProcessingService).sendAndReceive(any(DeleteXroadGatewayCacheRequest.class));
}
}
package ee.sm.ti.teis.commongateway.xroadgateway;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import java.time.LocalDate;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser
class XroadEmtakTestControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final String BASE_URL = "/xroad/emtak/";
@Autowired
XroadEmtakTestController controller;
MockMvcUtil mockMvcUtil;
@Test
void getEmtakChanges_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmtakChanges(null, null, REQUEST_META_DTO));
void getEmtakChanges_success() {
when(requestProcessingService.sendAndReceive(any(EmtakXroadRequest.class)))
.thenReturn("test");
parameters.add("startDate", LocalDate.now().toString());
mockMvcUtil.testGet(BASE_URL, parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(EmtakXroadRequest.class));
}
@Test
void getEmtakItems_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmtakItems(REQUEST_META_DTO));
void getEmtakItems_success() {
when(requestProcessingService.sendAndReceive(any(EmtakItemsXroadRequest.class)))
.thenReturn("test");
parameters.add("startDate", LocalDate.now().toString());
mockMvcUtil.testGet(BASE_URL + "items", parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(EmtakItemsXroadRequest.class));
}
}
package ee.sm.ti.teis.commongateway.xroadgateway;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser
class XroadTorControllerTest extends CommonApiGatewayTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
XroadTorController controller;
MockMvcUtil mockMvcUtil;
@Test
void getEmployeesFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmployeesFromTor("emplId", REQUEST_META_DTO));
void getEmployeesFromTor_success() {
when(requestProcessingService.sendAndReceive(any(TorEmployeesXroadRequest.class)))
.thenReturn("test");
mockMvcUtil.testGet("/xroad/tor/employees/" + randomUUID(), null, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(TorEmployeesXroadRequest.class));
}
}
package ee.sm.ti.teis.commongateway.xroadgateway;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser
class XroadTorTestControllerTest extends CommonApiGatewayTestBase {
private static final String EMPL_ID_PARAMETER = "emplId";
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final String BASE_URL = "/xroad/tor/";
@Autowired
XroadTorTestController controller;
MockMvcUtil mockMvcUtil;
@Test
void geNumberOfEmployeesFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.geNumberOfEmployeesFromTor(EMPL_ID_PARAMETER, REQUEST_META_DTO));
void getEmployersFromTor_success() {
when(requestProcessingService.sendAndReceive(any(TorEmployersXroadRequest.class)))
.thenReturn("test");
parameters.add("employeeId", randomUUID().toString());
mockMvcUtil.testGet(BASE_URL + "employers/" + randomUUID(), parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(TorEmployersXroadRequest.class));
}
@Test
void getEmployersFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getEmployersFromTor(EMPL_ID_PARAMETER, REQUEST_META_DTO));
void getLocationsFromTor_success() {
when(requestProcessingService.sendAndReceive(any(TorLocationsXroadRequest.class)))
.thenReturn("test");
parameters.add("employeeId", randomUUID().toString());
mockMvcUtil.testGet(BASE_URL + "locations/" + randomUUID(), parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(TorLocationsXroadRequest.class));
}
@Test
void getLocationsFromTor_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getLocationsFromTor(EMPL_ID_PARAMETER, REQUEST_META_DTO));
void getNumberOfEmployeesFromTor_success() {
when(requestProcessingService.sendAndReceive(any(TorNrOfEmployeesXroadRequest.class)))
.thenReturn("test");
parameters.add("employeeId", randomUUID().toString());
mockMvcUtil.testGet(BASE_URL + "number-of-employees/" + randomUUID(), parameters, new TypeReference<String>() {
}, true);
verify(requestProcessingService).sendAndReceive(any(TorNrOfEmployeesXroadRequest.class));
}
}
......@@ -2,6 +2,7 @@ package ee.sm.ti.teis.commongateway.xroadgateway;
import ee.sm.ti.teis.commongateway.person.LegalPersonDto;
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;
......@@ -22,24 +23,25 @@ import java.util.UUID;
@Validated
@RequiredArgsConstructor
public class XroadArController extends TeisBaseController {
private final XroadProcessingService xroadProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "Ärireigistrist saadakse ettevõtte esindusõigust omavate isikute andmed.")
@ApiImplicitParams({
@ApiImplicitParam(name = "employerId", value = "f1e5abf2-9f24-45c2-b5e3-2d6bd05d33e4")
})
@GetMapping(value = "company-representatives/{employerId}", produces = MediaType.APPLICATION_JSON_VALUE)
public String getCompanyRepresentativesFromAR(@PathVariable String employerId, RequestMetaDTO requestMetaDTO) {
public String getCompanyRepresentativesFromAR(@PathVariable String employerId, RequestMetaDTO requestMetaDTO) {
ArRepresentativesXroadRequest request = new ArRepresentativesXroadRequest();
request.setPayload(new ArRepresentativesXroadRequest.Parameters(employerId), requestMetaDTO);
return xroadProcessingService.executeXroadRequest(request);
return (String) service.sendAndReceive(request);
}
@ApiOperation(value = "Ärireigistrist päritakse x-tee teenusega ettevõtte lihtandmed.")
@GetMapping(value = "company", produces = MediaType.APPLICATION_JSON_VALUE)
public String getCompanyFromAR(@RequestParam(required = false) @Size(min = 2) String name,
@RequestParam(required = false) @Min(1) @Max(999999999) BigInteger regCode,
RequestMetaDTO requestMetaDTO) {
@RequestParam(required = false) @Min(1) @Max(999999999) BigInteger regCode, RequestMetaDTO requestMetaDTO) {
ArCompanyXroadRequest request = new ArCompanyXroadRequest();
if (regCode == null && name == null) {
throw new IllegalArgumentException("Name or regCode must be provided");
......@@ -53,7 +55,8 @@ public class XroadArController extends TeisBaseController {
.regCode(regCodeString)
.build());
request.setPayload(payload, requestMetaDTO);
return xroadProcessingService.executeXroadRequest(request);
return (String) service.sendAndReceive(request);
}
......@@ -65,6 +68,7 @@ public class XroadArController extends TeisBaseController {
public String getCompanyDetailsFromAr(@PathVariable String id, RequestMetaDTO requestMetaDTO) {
ArCompanyDetailsXroadRequest request = new ArCompanyDetailsXroadRequest();
request.setPayload(new ArCompanyDetailsXroadRequest.Parameters(UUID.fromString(id)), requestMetaDTO);
return xroadProcessingService.executeXroadRequest(request);
return (String) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.xroadgateway;
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;
......@@ -21,16 +22,18 @@ import org.springframework.web.bind.annotation.RestController;
@Validated
@RequiredArgsConstructor
public class XroadArTestController extends TeisBaseController {
private final XroadProcessingService xroadProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "Äriregistrist või cache-st loetakse ettevõtted, mille suhtes isikul on esindusõigus.")
@ApiImplicitParams({
@ApiImplicitParam(name = "personId", value = "f1fac71a-985f-4ed5-82aa-90e90b7b29d4")
})
@GetMapping(value = "company-representations/{personId}", produces = MediaType.APPLICATION_JSON_VALUE)
public String getRepresentationsFromAR(@PathVariable String personId, RequestMetaDTO requestMetaDTO) {
public String getRepresentationsFromAR(@PathVariable String personId, RequestMetaDTO requestMetaDTO) {
ArRepresentationsXroadRequest request = new ArRepresentationsXroadRequest();
request.setPayload(new ArRepresentationsXroadRequest.Parameters(personId), requestMetaDTO);
return xroadProcessingService.executeXroadRequest(request);
return (String) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.xroadgateway;
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;
......@@ -19,7 +20,7 @@ import static java.util.Optional.ofNullable;
@RequiredArgsConstructor
public class XroadCacheTestController extends TeisBaseController {
private final XroadProcessingService xRoadProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "X-tee/Redis cache väärtuste päringu teenus. ", response = String.class)
@ApiImplicitParams({
......@@ -27,11 +28,12 @@ public class XroadCacheTestController extends TeisBaseController {
@ApiImplicitParam(name = "id", value = "Cache objekti ID")
})
@GetMapping(value = "{name}", produces = MediaType.APPLICATION_JSON_VALUE)
public String getXroadCacheObjectById(@PathVariable(name = "name") String name,
@RequestParam(name = "id", required = false) String id, RequestMetaDTO requestMetaDTO) {
public String getXroadCacheObjectById(@PathVariable(name = "name") String name, @RequestParam(name = "id", required = false) String id,
RequestMetaDTO requestMetaDTO) {
XroadGatewayCacheRequest request = new XroadGatewayCacheRequest();
request.setPayload(new XroadGatewayCacheRequest.Parameters(name, ofNullable(id).orElse("")), requestMetaDTO);
return xRoadProcessingService.getXroadCache(request);
return (String) service.sendAndReceive(request);
}
@ApiOperation(value = "X-tee/Redis cache uuendamise teenus", response = String.class)
......@@ -39,12 +41,12 @@ public class XroadCacheTestController extends TeisBaseController {
@ApiImplicitParam(name = "name", value = "Cache'i nimi: getNumberOfEmployeesFromTOR", required = true)
})
@PostMapping(value = "{name}", produces = MediaType.APPLICATION_JSON_VALUE)
public String createXroadCacheObjects(@PathVariable(name = "name") String name,
@ApiParam(name = "value", value = "JSON formaadis cache väärtuste nimekiri", required = true)
@RequestBody String value, RequestMetaDTO requestMetaDTO) {
public String createXroadCacheObjects(@PathVariable(name = "name") String name, @ApiParam(name = "value", value = "JSON formaadis cache väärtuste nimekiri", required = true)
@RequestBody String value, RequestMetaDTO requestMetaDTO) {
UpdateXroadGatewayCacheRequest request = new UpdateXroadGatewayCacheRequest();
request.setPayload(new UpdateXroadGatewayCacheRequest.Parameters(name, value), requestMetaDTO);
return xRoadProcessingService.updateXroadGatewayCache(request);
return (String) service.sendAndReceive(request);
}
@ApiOperation(value = "X-tee/Redis cache väärtuste kustutamise teenus", response = String.class)
......@@ -53,10 +55,11 @@ public class XroadCacheTestController extends TeisBaseController {
@ApiImplicitParam(name = "id", value = "Cache objekti ID või * kogu cache'i kustutamiseks.", required = true)
})
@DeleteMapping(value = "{name}", produces = MediaType.APPLICATION_JSON_VALUE)
public String deleteXroadCacheObject(@PathVariable(name = "name") String name,
@RequestParam(name = "id") String id, RequestMetaDTO requestMetaDTO) {
public String deleteXroadCacheObject(@PathVariable(name = "name") String name, @RequestParam(name = "id") String id,
RequestMetaDTO requestMetaDTO) {
DeleteXroadGatewayCacheRequest request = new DeleteXroadGatewayCacheRequest();
request.setPayload(new DeleteXroadGatewayCacheRequest.Parameters(name, id), requestMetaDTO);
return xRoadProcessingService.deleteXroadCache(request);
return (String) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.xroadgateway;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Profile;
......@@ -19,22 +20,23 @@ import java.time.LocalDate;
@RequiredArgsConstructor
public class XroadEmtakTestController extends TeisBaseController {
private final XroadProcessingService xroadProcessingService;
private final RequestProcessingService service;
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public String getEmtakChanges(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate,
RequestMetaDTO requestMetaDTO) {
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate, RequestMetaDTO requestMetaDTO) {
EmtakXroadRequest request = new EmtakXroadRequest();
request.setPayload(new EmtakXroadRequest.Parameters(startDate, endDate), requestMetaDTO);
return xroadProcessingService.executeXroadRequest(request);
return (String) service.sendAndReceive(request);
}
@GetMapping(value="/items" ,produces = MediaType.APPLICATION_JSON_VALUE)
public String getEmtakItems( RequestMetaDTO requestMetaDTO) {
@GetMapping(value = "/items", produces = MediaType.APPLICATION_JSON_VALUE)