Commit 55d8be78 authored by Hando Lukats's avatar Hando Lukats
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Hando Lukats

See merge request teis/xroad-gateway!105
parents d5e6ae04 765ae771
# Changelog
## [1.13.0] - 2022-03-10
* TEIS-2875: new logic for getting TVLs from KIRST
* TEIS-2756: added xroad rr representation classes
## [1.12.0] - 2022-02-10
* TEIS-2814: added getVehiclesFromLr request methods
......
theGroup=ee.sm.ti.teis
theVersion=1.12.0
commonsVersion=1.31.0
commonApiGatewayVersion=1.31.0
theVersion=1.13.0
commonsVersion=1.32.0
commonApiGatewayVersion=1.32.0
pluginVersion=1.4.4
jaxbVersion=2.3.1
package ee.sm.ti.teis;
import ee.sm.ti.teis.parameter.ParameterServiceClient;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
......@@ -33,6 +35,9 @@ public abstract class XroadGatewayAppTestBase {
redisContainer.start();
}
@MockBean
public ParameterServiceClient parameterServiceClient;
protected void clearRedisCache() {
try {
redisContainer.execInContainer("redis-cli", "flushall");
......
package ee.sm.ti.teis.xroadgateway.kirst;
import ee.sm.ti.teis.XroadGatewayAppTestBase;
import ee.sm.ti.teis.commongateway.accidents.accidentcase.dto.GetAccidentCaseDataFromKirstDto;
import ee.sm.ti.teis.commongateway.accidents.accidentincapacitycertificate.GetAccidentIncapacityCertificateDataFromKirstDto;
import ee.sm.ti.teis.commongateway.xroadgateway.XroadResponse;
import ee.sm.ti.teis.commongateway.xroadgateway.kirst.GetTVLListFromKirstDto;
import ee.sm.ti.teis.commongateway.xroadgateway.kirst.GetTVLListFromKirstXroadTestRequest;
import ee.sm.ti.teis.domain.kirst.TVLFromKirst;
import ee.sm.ti.teis.domain.kirst.TVLListFromKirst;
import ee.sm.ti.teis.domain.parameter.Parameter;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.utils.JsonMapper;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import static ee.sm.ti.teis.servicerequest.UserType.OFFICIAL_USER;
import static ee.sm.ti.teis.types.enums.RolePrivilegeCode.TI_MANAGE_PROCEDURALACT;
import static ee.sm.ti.teis.types.enums.parameters.AccidentCaseParameterType.DURATION_INCAPACITY_CERTIFICATES;
import static ee.sm.ti.teis.utils.TestUtils.assertBadRequest;
import static ee.sm.ti.teis.utils.TestUtils.createRequestMeta;
import static java.util.UUID.randomUUID;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.doReturn;
public class KirstGwTestListenerTest extends XroadGatewayAppTestBase {
private static final String ID_CODE = "25411860487";
private static final LocalDate PERIOD_START = LocalDate.of(2022, 1, 1);
private static final String CERTIFICATE_ID = "45454545454545";
@Autowired
KirstGwTestListener listener;
@Autowired
JsonMapper jsonMapper;
RequestMetaDTO requestMetaDTO;
GetTVLListFromKirstXroadTestRequest request;
GetTVLListFromKirstDto payload;
GetAccidentCaseDataFromKirstDto getAccidentCaseData;
GetAccidentIncapacityCertificateDataFromKirstDto getCertificateData;
XroadResponse response;
@BeforeEach
void setUp() {
requestMetaDTO = createRequestMeta(randomUUID().toString(), OFFICIAL_USER, null, List.of(TI_MANAGE_PROCEDURALACT.name()));
payload = new GetTVLListFromKirstDto();
getAccidentCaseData = GetAccidentCaseDataFromKirstDto.builder()
.idCode(ID_CODE)
.fromDate(PERIOD_START)
.build();
getCertificateData = GetAccidentIncapacityCertificateDataFromKirstDto.builder()
.certificateId(CERTIFICATE_ID)
.build();
request = new GetTVLListFromKirstXroadTestRequest();
request.setPayload(payload, requestMetaDTO);
Parameter certDuration = Parameter.builder().value("30").build();
doReturn(certDuration)
.when(parameterServiceClient)
.getParameterByCodeWithoutScope(DURATION_INCAPACITY_CERTIFICATES.name(), requestMetaDTO);
}
@Test
void get_idCodeMissing_badRequest() {
getAccidentCaseData.setIdCode(null);
payload.setCases(List.of(getAccidentCaseData));
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getViolations().stream()
.anyMatch(violation -> violation.getFieldName().equals("testGetTVLList.dto.cases[0].idCode")))
.isTrue();
}
@Test
void get_fromDateMissing_badRequest() {
getAccidentCaseData.setFromDate(null);
payload.setCases(List.of(getAccidentCaseData));
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getViolations().stream()
.anyMatch(violation -> violation.getFieldName().equals("testGetTVLList.dto.cases[0].fromDate")))
.isTrue();
}
@Test
void get_certificateIdMissing_badRequest() {
getCertificateData.setCertificateId(null);
payload.setCertificates(List.of(getCertificateData));
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getViolations().stream()
.anyMatch(violation -> violation.getFieldName().equals("testGetTVLList.dto.certificates[0].certificateId")))
.isTrue();
}
@Test
void get_accidentCaseDataAndCertificateDataProvided_badRequest() {
payload.setCases(List.of(getAccidentCaseData));
payload.setCertificates(List.of(getCertificateData));
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getMessage()).isEqualTo("Only cases data or certificates data must be provided");
}
@Test
void get_accidentCaseDataProvided_success() {
payload.setCases(List.of(getAccidentCaseData));
response = listener.getTVLListFromKirst(request);
assertThat(response.getError()).isNull();
TVLListFromKirst domain = jsonMapper.readObject(response.getPayload(), TVLListFromKirst.class);
assertThat(domain.getIncapacityCertificates().size()).isGreaterThanOrEqualTo(1);
TVLFromKirst tvl = domain.getIncapacityCertificates().stream()
.filter(cert -> cert.getCertificateId().equals("2347283749234"))
.findFirst().orElse(null);
assertThat(tvl.getCertificateStatus()).isEqualTo("avatud");
assertThat(tvl.getCertificateLastChange()).isEqualTo(LocalDateTime.of(2022, 1, 1, 12, 0, 0));
assertThat(tvl.getCertificateReason()).isEqualTo("INCAPACITY_FOR_WORK_REASON__2");
assertThat(tvl.getNumberOfDays()).isEqualTo(31);
assertThat(tvl.getPeriodStart()).isEqualTo(getAccidentCaseData.getFromDate());
assertThat(tvl.getPeriodEnd()).isEqualTo(LocalDate.of(2022, 1, 31));
assertThat(tvl.getMedicFirstName()).isEqualTo("Pahalane");
assertThat(tvl.getMedicLastName()).isEqualTo("Kärbes");
assertThat(tvl.getMedicPhoneNumber()).isEqualTo("254886523");
assertThat(tvl.getMedicalInstitutionRegCode()).isEqualTo("11889992");
assertThat(tvl.getMedicalInstitutionName()).isEqualTo("Kommipood");
assertThat(tvl.getDiagnosis()).isEqualTo("It's serious");
assertThat(tvl.getIdCode()).isEqualTo(ID_CODE);
}
}
package ee.sm.ti.teis.xroadgateway.kirst;
import ee.sm.ti.teis.XroadGatewayAppTestBase;
import ee.sm.ti.teis.domain.kirst.*;
import ee.sm.ti.teis.domain.parameter.Parameter;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.xroadgateway.config.KirstQueueConfig.GetTVLListFromKirstMsRequest;
import ee.sm.ti.teis.xroadgateway.config.KirstQueueConfig.GetTVLListFromKirstMsResponse;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import static ee.sm.ti.teis.servicerequest.UserType.OFFICIAL_USER;
import static ee.sm.ti.teis.types.enums.RolePrivilegeCode.TI_MANAGE_PROCEDURALACT;
import static ee.sm.ti.teis.types.enums.parameters.AccidentCaseParameterType.DURATION_INCAPACITY_CERTIFICATES;
import static ee.sm.ti.teis.utils.TestUtils.assertBadRequest;
import static ee.sm.ti.teis.utils.TestUtils.createRequestMeta;
import static java.util.UUID.randomUUID;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.doReturn;
public class KirstMsListenerTest extends XroadGatewayAppTestBase {
private static final String ID_CODE = "25411860487";
private static final String ID_CODE_2 = "58411020487";
private static final String ID_CODE_3 = "49108098765";
private static final LocalDate PERIOD_START = LocalDate.of(2022, 1, 1);
private static final LocalDate PERIOD_START_2 = LocalDate.of(2022, 3, 1);
private static final String CERTIFICATE_ID = "45454545454545";
private static final String CERTIFICATE_ID_2 = "6767676767676767";
@Autowired
KirstMsListener listener;
RequestMetaDTO requestMetaDTO;
GetTVLListFromKirstMsRequest request;
GetTVLListFromKirst payload;
GetTVLListFromKirstMsResponse response;
GetAccidentCaseDataFromKirst getAccidentCaseData;
GetAccidentCaseDataFromKirst getAccidentCaseData2;
GetAccidentCaseDataFromKirst getAccidentCaseData3;
GetAccidentIncapacityCertificateDataFromKirst getCertificateData;
GetAccidentIncapacityCertificateDataFromKirst getCertificateData2;
@BeforeEach
void setUp() {
requestMetaDTO = createRequestMeta(randomUUID().toString(), OFFICIAL_USER, null, List.of(TI_MANAGE_PROCEDURALACT.name()));
payload = new GetTVLListFromKirst();
getAccidentCaseData = GetAccidentCaseDataFromKirst.builder()
.idCode(ID_CODE)
.fromDate(PERIOD_START)
.build();
getAccidentCaseData2 = GetAccidentCaseDataFromKirst.builder()
.idCode(ID_CODE_2)
.fromDate(PERIOD_START_2)
.build();
getAccidentCaseData3 = GetAccidentCaseDataFromKirst.builder()
.idCode(ID_CODE_3)
.fromDate(PERIOD_START)
.build();
getCertificateData = GetAccidentIncapacityCertificateDataFromKirst.builder()
.certificateId(CERTIFICATE_ID)
.build();
getCertificateData2 = GetAccidentIncapacityCertificateDataFromKirst.builder()
.certificateId(CERTIFICATE_ID_2)
.build();
request = new GetTVLListFromKirstMsRequest();
request.setPayload(payload, requestMetaDTO);
Parameter certDuration = Parameter.builder().value("30").build();
doReturn(certDuration)
.when(parameterServiceClient)
.getParameterByCodeWithoutScope(DURATION_INCAPACITY_CERTIFICATES.name(), requestMetaDTO);
}
@Test
void get_idCodeMissing_badRequest() {
getAccidentCaseData.setIdCode(null);
payload.setCases(List.of(getAccidentCaseData));
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getViolations().stream()
.anyMatch(violation -> violation.getFieldName().equals("getTVLList.domain.cases[0].idCode")))
.isTrue();
}
@Test
void get_fromDateMissing_badRequest() {
getAccidentCaseData.setFromDate(null);
payload.setCases(List.of(getAccidentCaseData));
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getViolations().stream()
.anyMatch(violation -> violation.getFieldName().equals("getTVLList.domain.cases[0].fromDate")))
.isTrue();
}
@Test
void get_certificateIdMissing_badRequest() {
getCertificateData.setCertificateId(null);
payload.setCertificates(List.of(getCertificateData));
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getViolations().stream()
.anyMatch(violation -> violation.getFieldName().equals("getTVLList.domain.certificates[0].certificateId")))
.isTrue();
}
@Test
void get_accidentCaseDataAndCertificateDataProvided_badRequest() {
payload.setCases(List.of(getAccidentCaseData));
payload.setCertificates(List.of(getCertificateData));
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getMessage()).isEqualTo("Only cases data or certificates data must be provided");
}
@Test
void get_noDataProvided_badRequest() {
payload.setCases(null);
payload.setCertificates(null);
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getMessage()).isEqualTo("Either cases list or certificates list must be provided");
}
@Test
void get_emptyListsProvided_badRequest() {
payload.setCases(new ArrayList<>());
payload.setCertificates(new ArrayList<>());
request.setPayload(payload, requestMetaDTO);
response = listener.getTVLListFromKirst(request);
assertBadRequest(response.getError());
assertThat(response.getError().getMessage()).isEqualTo("Either cases list or certificates list must be provided");
}
@Test
void get_oneAccidentCaseDataProvided_success() {
payload.setCases(List.of(getAccidentCaseData));
response = listener.getTVLListFromKirst(request);
assertThat(response.getError()).isNull();
TVLListFromKirst domain = response.getPayload();
assertThat(domain.getIncapacityCertificates().size()).isGreaterThanOrEqualTo(1);
TVLFromKirst tvl = domain.getIncapacityCertificates().stream()
.filter(cert -> cert.getCertificateId().equals("2347283749234"))
.findFirst().orElse(null);
assertThat(tvl.getCertificateStatus()).isEqualTo("avatud");
assertThat(tvl.getCertificateLastChange()).isEqualTo(LocalDateTime.of(2022, 1, 1, 12, 0, 0));
assertThat(tvl.getCertificateReason()).isEqualTo("INCAPACITY_FOR_WORK_REASON__2");
assertThat(tvl.getNumberOfDays()).isEqualTo(31);
assertThat(tvl.getPeriodStart()).isEqualTo(getAccidentCaseData.getFromDate());
assertThat(tvl.getPeriodEnd()).isEqualTo(LocalDate.of(2022, 1, 31));
assertThat(tvl.getMedicFirstName()).isEqualTo("Pahalane");
assertThat(tvl.getMedicLastName()).isEqualTo("Kärbes");
assertThat(tvl.getMedicPhoneNumber()).isEqualTo("254886523");
assertThat(tvl.getMedicalInstitutionRegCode()).isEqualTo("11889992");
assertThat(tvl.getMedicalInstitutionName()).isEqualTo("Kommipood");
assertThat(tvl.getDiagnosis()).isEqualTo("It's serious");
assertThat(tvl.getIdCode()).isEqualTo(ID_CODE);
}
@Test
void get_threeAccidentCaseDataProvided_twoFitThePeriod_returnsTwo_success() {
payload.setCases(List.of(getAccidentCaseData, getAccidentCaseData2, getAccidentCaseData3));
response = listener.getTVLListFromKirst(request);
assertThat(response.getError()).isNull();
TVLListFromKirst domain = response.getPayload();
assertThat(domain.getIncapacityCertificates().size()).isGreaterThanOrEqualTo(2);
TVLFromKirst tvl1 = domain.getIncapacityCertificates().stream()
.filter(cert -> cert.getCertificateId().equals("2347283749234"))
.findFirst().orElse(null);
assertThat(tvl1.getCertificateStatus()).isEqualTo("avatud");
assertThat(tvl1.getCertificateLastChange()).isEqualTo(LocalDateTime.of(2022, 1, 1, 12, 0, 0));
assertThat(tvl1.getCertificateReason()).isEqualTo("INCAPACITY_FOR_WORK_REASON__2");
assertThat(tvl1.getNumberOfDays()).isEqualTo(31);
assertThat(tvl1.getPeriodStart()).isEqualTo(getAccidentCaseData.getFromDate());
assertThat(tvl1.getPeriodEnd()).isEqualTo(LocalDate.of(2022, 1, 31));
assertThat(tvl1.getMedicFirstName()).isEqualTo("Pahalane");
assertThat(tvl1.getMedicLastName()).isEqualTo("Kärbes");
assertThat(tvl1.getMedicPhoneNumber()).isEqualTo("254886523");
assertThat(tvl1.getMedicalInstitutionRegCode()).isEqualTo("11889992");
assertThat(tvl1.getMedicalInstitutionName()).isEqualTo("Kommipood");
assertThat(tvl1.getDiagnosis()).isEqualTo("It's serious");
assertThat(tvl1.getIdCode()).isEqualTo(ID_CODE);
TVLFromKirst tvl2 = domain.getIncapacityCertificates().stream()
.filter(cert -> cert.getCertificateId().equals("97678984894574"))
.findFirst().orElse(null);
assertThat(tvl2.getCertificateStatus()).isEqualTo("arvutamine");
assertThat(tvl2.getCertificateLastChange()).isEqualTo(LocalDateTime.of(2022, 3, 1, 12, 0, 0));
assertThat(tvl2.getCertificateReason()).isEqualTo("INCAPACITY_FOR_WORK_REASON__8");
assertThat(tvl2.getNumberOfDays()).isEqualTo(31);
assertThat(tvl2.getPeriodStart()).isEqualTo(getAccidentCaseData2.getFromDate());
assertThat(tvl2.getPeriodEnd()).isEqualTo(LocalDate.of(2022, 3, 31));
assertThat(tvl2.getMedicFirstName()).isEqualTo("Kaspar");
assertThat(tvl2.getMedicLastName()).isEqualTo("Kala");
assertThat(tvl2.getMedicPhoneNumber()).isEqualTo("558886523");
assertThat(tvl2.getMedicalInstitutionRegCode()).isEqualTo("12197746");
assertThat(tvl2.getMedicalInstitutionName()).isEqualTo("Subaru Auto AS");
assertThat(tvl2.getIdCode()).isEqualTo(ID_CODE_2);
assertThat(tvl2.getDiagnosis()).isEqualTo("It's not serious");
assertThat(domain.getIncapacityCertificates().stream()
.noneMatch(cert -> cert.getCertificateId().equals("893635374324"))).isTrue();
}
@Test
void get_oneCertificateDataProvided_success() {
payload.setCertificates(List.of(getCertificateData));
response = listener.getTVLListFromKirst(request);
assertThat(response.getError()).isNull();
TVLListFromKirst domain = response.getPayload();
assertThat(domain.getIncapacityCertificates().size()).isGreaterThanOrEqualTo(1);
TVLFromKirst tvl = domain.getIncapacityCertificates().stream()
.filter(cert -> cert.getIdCode().equals("46806068785"))
.findFirst().orElse(null);
assertThat(tvl.getCertificateId()).isEqualTo(CERTIFICATE_ID);
assertThat(tvl.getCertificateStatus()).isEqualTo("arvutamine");
assertThat(tvl.getCertificateLastChange()).isEqualTo(LocalDateTime.of(2021, 12, 27, 12, 0, 0));
assertThat(tvl.getCertificateReason()).isEqualTo("INCAPACITY_FOR_WORK_REASON__6");
assertThat(tvl.getNumberOfDays()).isEqualTo(5);
assertThat(tvl.getPeriodStart()).isEqualTo(LocalDate.of(2021, 12, 27));
assertThat(tvl.getPeriodEnd()).isEqualTo(LocalDate.of(2021, 12, 31));
assertThat(tvl.getMedicFirstName()).isEqualTo("Karin");
assertThat(tvl.getMedicLastName()).isEqualTo("Kuusk");
assertThat(tvl.getMedicPhoneNumber()).isEqualTo("532165888");
assertThat(tvl.getMedicalInstitutionRegCode()).isEqualTo("10081234");
assertThat(tvl.getMedicalInstitutionName()).isEqualTo("Aitäh AS");
assertThat(tvl.getDiagnosis()).isEqualTo("Don't know yet");
}
@Test
void get_severalCertificateDataProvided_success() {
payload.setCertificates(List.of(getCertificateData, getCertificateData2));
response = listener.getTVLListFromKirst(request);
assertThat(response.getError()).isNull();
TVLListFromKirst domain = response.getPayload();
assertThat(domain.getIncapacityCertificates().size()).isGreaterThanOrEqualTo(2);
TVLFromKirst tvl1 = domain.getIncapacityCertificates().stream()
.filter(cert -> cert.getIdCode().equals("46806068785"))
.findFirst().orElse(null);
assertThat(tvl1.getCertificateId()).isEqualTo(CERTIFICATE_ID);
assertThat(tvl1.getCertificateStatus()).isEqualTo("arvutamine");
assertThat(tvl1.getCertificateLastChange()).isEqualTo(LocalDateTime.of(2021, 12, 27, 12, 0, 0));
assertThat(tvl1.getCertificateReason()).isEqualTo("INCAPACITY_FOR_WORK_REASON__6");
assertThat(tvl1.getNumberOfDays()).isEqualTo(5);
assertThat(tvl1.getPeriodStart()).isEqualTo(LocalDate.of(2021, 12, 27));
assertThat(tvl1.getPeriodEnd()).isEqualTo(LocalDate.of(2021, 12, 31));
assertThat(tvl1.getMedicFirstName()).isEqualTo("Karin");
assertThat(tvl1.getMedicLastName()).isEqualTo("Kuusk");
assertThat(tvl1.getMedicPhoneNumber()).isEqualTo("532165888");
assertThat(tvl1.getMedicalInstitutionRegCode()).isEqualTo("10081234");
assertThat(tvl1.getMedicalInstitutionName()).isEqualTo("Aitäh AS");
assertThat(tvl1.getDiagnosis()).isEqualTo("Don't know yet");
TVLFromKirst tvl2 = domain.getIncapacityCertificates().stream()
.filter(cert -> cert.getIdCode().equals("61202084253"))
.findFirst().orElse(null);
assertThat(tvl2.getCertificateId()).isEqualTo(CERTIFICATE_ID_2);
assertThat(tvl2.getCertificateStatus()).isEqualTo("registreeritud");
assertThat(tvl2.getCertificateLastChange()).isEqualTo(LocalDateTime.of(2021, 11, 11, 12, 0, 0));
assertThat(tvl2.getCertificateReason()).isEqualTo("INCAPACITY_FOR_WORK_REASON__6");
assertThat(tvl2.getNumberOfDays()).isEqualTo(1);
assertThat(tvl2.getPeriodStart()).isEqualTo(LocalDate.of(2021, 11, 11));
assertThat(tvl2.getPeriodEnd()).isEqualTo(LocalDate.of(2021, 11, 11));
assertThat(tvl2.getMedicFirstName()).isEqualTo("Juss");
assertThat(tvl2.getMedicLastName()).isEqualTo("Jonnipunn");
assertThat(tvl2.getMedicPhoneNumber()).isEqualTo("532165777");
assertThat(tvl2.getMedicalInstitutionRegCode()).isEqualTo("10039988");
assertThat(tvl2.getMedicalInstitutionName()).isEqualTo("GoodClinic");
assertThat(tvl2.getDiagnosis()).isEqualTo("Mysterious disease");
}
}
package ee.sm.ti.teis.xroadgateway.rr;
import ee.sm.ti.teis.xroadgateway.rr.service.RrXroadService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.test.context.ActiveProfiles;
import static org.mockito.Mockito.mock;
@Configuration
@ActiveProfiles("integtest")
public class RrMockConfig {
@Bean
@Primary
public RrXroadService rrXroadService() {
return mock(RrXroadService.class);
}
}
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.1
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2022.03.02 at 05:05:43 PM CET
//
package ee.sm.ti.teis.generated.representations;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for AadressAndmed complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="AadressAndmed"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="Aadress"&gt;
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;