Skip to content

Commit

Permalink
[GITFLOW]merging 'hotfix-1.74.3' into 'master-1.74.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
MateStrysewske committed Aug 24, 2022
2 parents 2c0a8f8 + a3cf6a7 commit 42a4345
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 33 deletions.
2 changes: 1 addition & 1 deletion sormas-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sormas-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sormas-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@
import de.symeda.sormas.api.i18n.I18nProperties;
import de.symeda.sormas.api.i18n.Strings;
import de.symeda.sormas.api.share.ExternalShareStatus;
import de.symeda.sormas.backend.caze.Case;
import de.symeda.sormas.backend.caze.CaseService;
import de.symeda.sormas.backend.common.ConfigFacadeEjb.ConfigFacadeEjbLocal;
import de.symeda.sormas.backend.event.Event;
import de.symeda.sormas.backend.event.EventService;
import de.symeda.sormas.backend.share.ExternalShareInfoService;

Expand Down Expand Up @@ -73,11 +71,6 @@ public void sendCases(List<String> caseUuids, boolean archived) throws ExternalS
params.setArchived(archived);

sendRequest(params);

caseUuids.forEach(uuid -> {
Case caze = caseService.getByUuid(uuid);
shareInfoService.createAndPersistShareInfo(caze, ExternalShareStatus.SHARED);
});
}

@Override
Expand All @@ -87,11 +80,6 @@ public void sendEvents(List<String> eventUuids, boolean archived) throws Externa
params.setArchived(archived);

sendRequest(params);

eventUuids.forEach(uuid -> {
Event event = eventService.getByUuid(uuid);
shareInfoService.createAndPersistShareInfo(event, ExternalShareStatus.SHARED);
});
}

private void sendRequest(ExportParameters params) throws ExternalSurveillanceToolException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import de.symeda.sormas.backend.AbstractBeanTest;
import de.symeda.sormas.backend.MockProducer;
import de.symeda.sormas.backend.TestDataCreator;
import de.symeda.sormas.backend.share.ExternalShareInfoService;

public class ExternalSurveillanceToolGatewayFacadeEjbTest extends AbstractBeanTest {

Expand Down Expand Up @@ -83,6 +82,23 @@ public void testFeatureIsDisabledWhenExternalSurvToolUrlIsEmpty() {
assertFalse(subjectUnderTest.isFeatureEnabled());
}

@Test
public void testSendingCasesOneCaseOk() throws ExternalSurveillanceToolException {
TestDataCreator.RDCF rdcf = creator.createRDCF();
UserReferenceDto user = creator.createUser(rdcf, creator.getUserRoleReference(DefaultUserRole.SURVEILLANCE_OFFICER)).toReference();
CaseDataDto case1 = creator.createCase(user, rdcf, null);

stubFor(
post(urlEqualTo("/export")).withRequestBody(containing(case1.getUuid()))
.withRequestBody(containing("caseUuids"))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));

subjectUnderTest.sendCases(Arrays.asList(case1.getUuid()), true);

ExternalShareInfoCriteria externalShareInfoCriteria1 = new ExternalShareInfoCriteria().caze(case1.toReference());
assertThat(getExternalShareInfoFacade().getIndexList(externalShareInfoCriteria1, 0, 100), hasSize(1));
}

@Test
public void testSendingCasesOk() throws ExternalSurveillanceToolException {
TestDataCreator.RDCF rdcf = creator.createRDCF();
Expand All @@ -98,8 +114,8 @@ public void testSendingCasesOk() throws ExternalSurveillanceToolException {

subjectUnderTest.sendCases(Arrays.asList(case1.getUuid(), case2.getUuid()), true);

assertThat(getExternalShareInfoFacade().getIndexList(new ExternalShareInfoCriteria().caze(case1.toReference()), 0, 100), hasSize(2));
assertThat(getExternalShareInfoFacade().getIndexList(new ExternalShareInfoCriteria().caze(case2.toReference()), 0, 100), hasSize(2));
assertThat(getExternalShareInfoFacade().getIndexList(new ExternalShareInfoCriteria().caze(case1.toReference()), 0, 100), hasSize(1));
assertThat(getExternalShareInfoFacade().getIndexList(new ExternalShareInfoCriteria().caze(case2.toReference()), 0, 100), hasSize(1));
}

@Test
Expand All @@ -118,14 +134,15 @@ public void testSendingCasesNotOk() {

@Test
public void testSendingEventsOk() throws ExternalSurveillanceToolException {
stubFor(
post(urlEqualTo("/export")).withRequestBody(containing("XRJOEJ-P2OY5E-CA5MYT-LSVCCGVY"))
.withRequestBody(containing("VXAERX-5RCKFA-G5DVXH-DPHPCAFB"))
.withRequestBody(containing("eventUuids"))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));
subjectUnderTest.sendEvents(Arrays.asList("XRJOEJ-P2OY5E-CA5MYT-LSVCCGVY", "VXAERX-5RCKFA-G5DVXH-DPHPCAFB"), true);
EventDto event1 = createEventDto("event1", "description1", "Event1", "Event1", "123");

stubFor(
post(urlEqualTo("/export")).withRequestBody(containing(event1.getUuid()))
.withRequestBody(containing("eventUuids"))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));
subjectUnderTest.sendEvents(Arrays.asList(event1.getUuid()), true);

assertThat(getBean(ExternalShareInfoService.class).getAll(), hasSize(2));
assertThat(getExternalShareInfoFacade().getIndexList(new ExternalShareInfoCriteria().event(event1.toReference()), 0, 100), hasSize(1));
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion sormas-base/dependencies/serverlibs.pom
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sormas-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<packaging>pom</packaging>
<version>1.74.2</version>
<version>1.74.3</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion sormas-cargoserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sormas-ear/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sormas-keycloak-service-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sormas-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sormas-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sormas-widgetset/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sormas-base</artifactId>
<groupId>de.symeda.sormas</groupId>
<version>1.74.2</version>
<version>1.74.3</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down

0 comments on commit 42a4345

Please sign in to comment.