Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions dsf-bpe/dsf-bpe-process-api-v1-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,27 +211,27 @@
<artifactItem>
<groupId>org.glassfish.hk2.external</groupId>
<artifactId>aopalliance-repackaged</artifactId>
<version>3.0.6</version>
<version>3.1.1</version>
</artifactItem>
<artifactItem>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-api</artifactId>
<version>3.0.6</version>
<version>3.1.1</version>
</artifactItem>
<artifactItem>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-locator</artifactId>
<version>3.0.6</version>
<version>3.1.1</version>
</artifactItem>
<artifactItem>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-utils</artifactId>
<version>3.0.6</version>
<version>3.1.1</version>
</artifactItem>
<artifactItem>
<groupId>org.glassfish.hk2</groupId>
<artifactId>osgi-resource-locator</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
</artifactItem>
<artifactItem>
<groupId>org.glassfish.jersey.connectors</groupId>
Expand Down
4 changes: 2 additions & 2 deletions dsf-bpe/dsf-bpe-server-jetty/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

FROM docker.io/library/debian:trixie-slim@sha256:4e401d95de7083948053197a9c3913343cd06b706bf15eb6a0c3ccd26f436a0e AS builder
FROM docker.io/library/debian:trixie-slim@sha256:28de0877c2189802884ccd20f15ee41c203573bd87bb6b883f5f46362d24c5c2 AS builder
WORKDIR /opt/bpe
COPY --chown=root:2202 ./ ./
RUN chown root:2202 ./ && \
Expand All @@ -23,7 +23,7 @@ RUN chown root:2202 ./ && \
chmod 1775 ./log


FROM docker.io/azul/zulu-openjdk:25-jre-headless@sha256:1fa90a584251b66adc28152e25cc496ea63dd787999c86a04c0e2033fa98d39a
FROM docker.io/azul/zulu-openjdk:25-jre-headless@sha256:701476f833e15ea883c329b20f272093b8434a4a9b09745ccdbd716f4f460567
LABEL org.opencontainers.image.source=https://github.com/datasharingframework/dsf
LABEL org.opencontainers.image.description="DSF BPE Server"
LABEL org.opencontainers.image.licenses="Apache License, Version 2.0"
Expand Down
1 change: 0 additions & 1 deletion dsf-bpe/dsf-bpe-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@
<dependency>
<groupId>com.icegreen</groupId>
<artifactId>greenmail-junit4</artifactId>
<version>1.6.15</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

com.fasterxml.jackson
com.google.common
com.sun.mail
dev.dsf.bpe.api
jakarta.activation
jakarta.inject
Expand All @@ -33,6 +34,7 @@ org.operaton.bpm.engine.impl.variable.serializer
org.operaton.bpm.engine.ProcessEngine
org.operaton.bpm.engine.RuntimeService
org.operaton.bpm.engine.variable
org.operaton.bpm.model.bpmn.impl
org.operaton.bpm.model.bpmn.instance
org.joda.time
org.glassfish.jersey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
# limitations under the License.
#

META-INF/services/org.operaton.bpm.model.bpmn.BpmnFactory
META-INF/services/org.operaton.bpm.model.bpmn.BpmnParserFactory
META-INF/mailcap
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ ca/uhn/fhir/i18n/hapi-messages.properties
dev/dsf/bpe/v1/plugin/ApiServicesSpringConfiguration.class
dev/dsf/bpe/v1/spring/ApiServiceConfig.class
META-INF/services/dev.dsf.bpe.api.plugin.ProcessPluginApiBuilder
META-INF/services/jakarta.ws.rs.client.ClientBuilder
META-INF/services/jakarta.ws.rs.ext.RuntimeDelegate
META-INF/services/org.glassfish.hk2.extension.ServiceLocatorGenerator
META-INF/services/org.glassfish.jersey.innate.inject.spi.ExternalRegistrables
META-INF/services/org.glassfish.jersey.internal.inject.InjectionManagerFactory
META-INF/services/org.glassfish.jersey.internal.spi.AutoDiscoverable
META-INF/services/org.glassfish.jersey.internal.spi.ForcedAutoDiscoverable
org/apache/http/client/version.properties
org/glassfish/jersey/client/internal/localization.properties
org/glassfish/jersey/internal/localization.properties
org/hl7/fhir/r4/model/fhirversion.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
com.fasterxml.jackson
com.google.common
com.ctc.wstx.stax.WstxInputFactory
com.sun.mail
dev.dsf.bpe.api
jakarta.activation
jakarta.annotation.Nonnull
Expand All @@ -38,6 +39,7 @@ org.operaton.bpm.engine.impl.variable.serializer
org.operaton.bpm.engine.ProcessEngine
org.operaton.bpm.engine.RuntimeService
org.operaton.bpm.engine.variable
org.operaton.bpm.model.bpmn.impl
org.operaton.bpm.model.bpmn.instance
org.glassfish.jersey
org.slf4j.Logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
# limitations under the License.
#

META-INF/mailcap
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ ca/uhn/fhir/i18n/hapi-messages.properties
dev/dsf/bpe/v2/plugin/ApiServicesSpringConfiguration.class
dev/dsf/bpe/v2/spring/ApiServiceConfig.class
META-INF/services/dev.dsf.bpe.api.plugin.ProcessPluginApiBuilder
org/apache/tika/mime/tika-mimetypes.xml
org/hl7/fhir/r4/hapi/model/fhirversion.properties
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.testcontainers.utility.DockerImageName;

import com.icegreen.greenmail.util.ServerSetupTest;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;
import de.hsheilbronn.mi.utils.crypto.keystore.KeyStoreCreator;
Expand Down Expand Up @@ -452,6 +454,11 @@ private static JettyServer startBpeServer(ServerSocketChannel statusConnectorCha
initParameters.put("dev.dsf.bpe.fhir.client.connections.config.default.trust.server.certificate.cas",
certificates.getCaCertificateFile().toString());

initParameters.put("dev.dsf.bpe.mail.host", "localhost");
initParameters.put("dev.dsf.bpe.mail.port", String.valueOf(ServerSetupTest.SMTP.getPort()));
initParameters.put("dev.dsf.bpe.mail.toAddresses", "to@localhost");
initParameters.put("dev.dsf.bpe.mail.fromAddress", "from@localhost");

initParameters.put("dev.dsf.bpe.test.env.mandatory", "test-value");

KeyStore clientCertificateTrustStore = KeyStoreCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,19 @@
import java.util.List;
import java.util.Optional;

import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.Message.RecipientType;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;

import org.hl7.fhir.r4.model.Binary;
import org.junit.BeforeClass;
import org.junit.Test;

import com.icegreen.greenmail.util.GreenMail;
import com.icegreen.greenmail.util.ServerSetupTest;

import de.hsheilbronn.mi.utils.crypto.ca.CertificateAuthority;
import de.hsheilbronn.mi.utils.crypto.ca.CertificationRequest;
import de.hsheilbronn.mi.utils.crypto.ca.CertificationRequest.CertificationRequestAndPrivateKey;
Expand Down Expand Up @@ -323,4 +332,43 @@ public void startQuestionnaireTestIdentifierMulti() throws Exception
{
executePluginTest(createTestTask("QuestionnaireTestIdentifierMulti"));
}

@Test
public void startMailServiceTest() throws Exception
{
GreenMail greenMail = new GreenMail(ServerSetupTest.SMTP);
greenMail.start();

try
{
executePluginTest(createTestTask("MailServiceTest"));

MimeMessage[] receivedMessages = greenMail.getReceivedMessages();

assertEquals(1, receivedMessages.length);

Address[] from = receivedMessages[0].getFrom();
assertNotNull(from);
assertEquals(1, from.length);
assertEquals("from@localhost", from[0].toString());

Address[] to = receivedMessages[0].getRecipients(RecipientType.TO);
assertNotNull(to);
assertEquals(1, to.length);
assertEquals("to@localhost", to[0].toString());

assertEquals("subject", receivedMessages[0].getSubject());

Object messagContent = receivedMessages[0].getContent();
assertTrue(messagContent instanceof MimeMultipart);
assertEquals(1, ((MimeMultipart) messagContent).getCount());
BodyPart bodyPart = ((MimeMultipart) messagContent).getBodyPart(0);
assertTrue(bodyPart.getContent() instanceof String);
assertEquals("message", bodyPart.getContent());
}
finally
{
greenMail.stop();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2018-2025 Heilbronn University of Applied Sciences
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.dsf.bpe.test.service;

import dev.dsf.bpe.test.AbstractTest;
import dev.dsf.bpe.test.PluginTest;
import dev.dsf.bpe.v2.ProcessPluginApi;
import dev.dsf.bpe.v2.activity.ServiceTask;
import dev.dsf.bpe.v2.error.ErrorBoundaryEvent;
import dev.dsf.bpe.v2.service.MailService;
import dev.dsf.bpe.v2.variables.Variables;

public class MailServiceTest extends AbstractTest implements ServiceTask
{
@Override
public void execute(ProcessPluginApi api, Variables variables) throws ErrorBoundaryEvent, Exception
{
executeTests(api, variables, api.getMailService());
}

@PluginTest
public void test(MailService mailService)
{
mailService.send("subject", "message");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import dev.dsf.bpe.test.service.FieldInjectionTest;
import dev.dsf.bpe.test.service.JsonVariableTestGet;
import dev.dsf.bpe.test.service.JsonVariableTestSet;
import dev.dsf.bpe.test.service.MailServiceTest;
import dev.dsf.bpe.test.service.MimeTypeServiceTest;
import dev.dsf.bpe.test.service.OrganizationProviderTest;
import dev.dsf.bpe.test.service.ProxyTest;
Expand Down Expand Up @@ -95,10 +96,10 @@ public static ActivityPrototypeBeanCreator activityPrototypeBeanCreator()
FieldInjectionTest.class, ErrorBoundaryEventTestThrow.class, ErrorBoundaryEventTestVerify.class,
ExceptionTest.class, CompressionServiceTest.class, ContinueSendTest.class, ContinueSendTestSend.class,
ContinueSendTestEvaluate.class, JsonVariableTestSet.class, JsonVariableTestGet.class,
CryptoServiceTest.class, MimeTypeServiceTest.class, FhirBinaryVariableTestSet.class,
FhirBinaryVariableTestGet.class, DsfClientTest.class, TargetProviderTest.class, DataLoggerTest.class,
AutowireTest.class, QuestionnaireTestAnswer.class, QuestionnaireTestAnswerCheck.class,
QuestionnaireTestSetIdentifies.class);
CryptoServiceTest.class, MailServiceTest.class, MimeTypeServiceTest.class,
FhirBinaryVariableTestSet.class, FhirBinaryVariableTestGet.class, DsfClientTest.class,
TargetProviderTest.class, DataLoggerTest.class, AutowireTest.class, QuestionnaireTestAnswer.class,
QuestionnaireTestAnswerCheck.class, QuestionnaireTestSetIdentifies.class);
}

@Bean
Expand Down
Loading
Loading