Skip to content
Snippets Groups Projects
Commit 945051ff authored by Jan Zickermann's avatar Jan Zickermann
Browse files

OZG-4094 pom: Use `stage` profile of osvi2-postfach

parent a10e35cc
No related branches found
No related tags found
1 merge request!2OZG-4094 osi2 postfach facade
......@@ -48,7 +48,7 @@
<bayernid-proxy-interface.version>0.7.0</bayernid-proxy-interface.version>
<vorgang-manager.version>2.17.0</vorgang-manager.version>
<muk-postfach.version>0.1.0</muk-postfach.version>
<osiv2-postfach.version>0.1.55-SNAPSHOT</osiv2-postfach.version>
<osiv2-postfach.version>0.1.0-SNAPSHOT</osiv2-postfach.version>
<api-lib.version>0.16.0</api-lib.version>
</properties>
......
spring:
security:
oauth2:
client:
registration:
other:
provider:
other:
\ No newline at end of file
......@@ -9,27 +9,33 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.ActiveProfiles;
import de.ozgcloud.common.test.ITCase;
import de.ozgcloud.nachrichten.NachrichtenManagerTestApplication;
import de.ozgcloud.nachrichten.attributes.ClientAttributeService;
import de.ozgcloud.nachrichten.email.EmailGrpcService;
import de.ozgcloud.nachrichten.postfach.osiv2.config.Osi2PostfachProperties;
import de.ozgcloud.nachrichten.postfach.osiv2.transfer.PostfachApiFacadeService;
import de.ozgcloud.vorgang.callcontext.WithMockCustomUser;
@ITCase
@TestPropertySource(properties = {
"ozgcloud.osiv2-postfach.enabled=true"
})
@SpringBootTest(classes = NachrichtenManagerTestApplication.class,
properties = {
"ozgcloud.osiv2-postfach.enabled=true"
})
@ActiveProfiles({ "itcase", "stage" })
class Osi2PostfachServiceITCase {
@Autowired
private PostfachService postfachService;
@Autowired
private Osi2PostfachProperties.ApiConfiguration osi2ApiConfiguration;
@MockBean
private ApplicationEventPublisher publisher;
......@@ -50,6 +56,14 @@ class Osi2PostfachServiceITCase {
sentEventTestListener.reset();
}
@DisplayName("should use stage profile properties")
@Test
void shouldUseStageProfileProperties() {
var url = osi2ApiConfiguration.getUrl();
assertThat(url).isNotEmpty();
}
@DisplayName("should call osi2 postfach send")
@Test
@WithMockCustomUser
......
......@@ -11,26 +11,28 @@ import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.event.EventListener;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.web.client.RestTemplate;
import de.ozgcloud.common.test.ITCase;
import de.ozgcloud.nachrichten.NachrichtenManagerTestApplication;
import de.ozgcloud.nachrichten.attributes.ClientAttributeService;
import de.ozgcloud.nachrichten.email.EmailGrpcService;
import de.ozgcloud.nachrichten.postfach.osi.MessageAttachmentService;
import lombok.SneakyThrows;
@ITCase
@TestPropertySource(properties = {
"ozgcloud.osi.postfach.proxyapi.key=key",
"ozgcloud.osi.postfach.proxyapi.realm=realm",
"ozgcloud.osi.postfach.proxyapi.url=url",
})
@SpringBootTest(classes = NachrichtenManagerTestApplication.class,
properties = {
"ozgcloud.osi.postfach.proxyapi.key=key",
"ozgcloud.osi.postfach.proxyapi.realm=realm",
"ozgcloud.osi.postfach.proxyapi.url=url",
})
@ActiveProfiles({ "itcase" })
class OsiPostfachServiceITCase {
@Autowired
......@@ -69,7 +71,6 @@ class OsiPostfachServiceITCase {
var commandId = "aaaaa";
when(restTemplate.exchange(eq("url"), eq(HttpMethod.POST), any(), Mockito.<Class<String>>any())).thenReturn(ResponseEntity.ok("true"));
postfachService.sendMail(commandId, "userId", osiNachricht);
assertThat(sentEventTestListener.events)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment