Skip to content
Snippets Groups Projects
Commit 6feed217 authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

Merge pull request 'OZG-4770 Trustlevel in ServiceKonto speichern' (#111) from...

Merge pull request 'OZG-4770 Trustlevel in ServiceKonto speichern' (#111) from OZG-4770-Trustlevel-in-ServiceKonto-speichern into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/eingang-manager/pulls/111


Reviewed-by: default avatarOZG-Cloud Team <noreply@ozg-sh.de>
parents 60dee6c7 cdba05ec
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ public class ServiceKonto {
private String type;
@Singular
private List<PostfachAddress> postfachAddresses;
private String trustLevel;
@Getter
@Builder
......
......@@ -3,14 +3,16 @@ package de.ozgcloud.eingang.common.formdata;
public class ServiceKontoTestFactory {
public static final String TYPE = "OSI";
public static final String TRUST_LEVEL = "STORK-QAA-Level-2";
public static ServiceKonto create() {
return createBuilder().build();
}
private static ServiceKonto.ServiceKontoBuilder createBuilder() {
public static ServiceKonto.ServiceKontoBuilder createBuilder() {
return ServiceKonto.builder()
.type(TYPE)
.trustLevel(TRUST_LEVEL)
.postfachAddress(PostfachAddressTestFactory.create());
}
}
......@@ -54,7 +54,7 @@
</modules>
<properties>
<vorgang-manager.version>2.4.0</vorgang-manager.version>
<vorgang-manager.version>2.6.0-SNAPSHOT</vorgang-manager.version>
<jsoup.version>1.14.3</jsoup.version>
<xmlschema.version>2.3.0</xmlschema.version>
......
......@@ -2,6 +2,7 @@ package de.ozgcloud.eingang.router;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -18,6 +19,8 @@ import de.ozgcloud.vorgang.vorgang.GrpcServiceKonto;
@Component
class ServiceKontoMapper {
static final String DEFAULT_TRUST_LEVEL = "STORK-QAA-Level-1";
@Autowired
private GrpcObjectMapper grpcObjectMapper;
......@@ -25,6 +28,7 @@ class ServiceKontoMapper {
return GrpcServiceKonto.newBuilder()
.setType(serviceKonto.getType())
.addAllPostfachAddresses(getPostfachAddresses(serviceKonto))
.setTrustLevel(Optional.ofNullable(serviceKonto.getTrustLevel()).orElse(DEFAULT_TRUST_LEVEL))
.build();
}
......
......@@ -64,6 +64,20 @@ class ServiceKontoMapperTest {
assertThat(serviceKonto.getType()).isEqualTo(ServiceKontoTestFactory.TYPE);
}
@Test
void shouldContainsDefaultTrustLevel() {
var serviceKonto = mapper.toServiceKonto(ServiceKontoTestFactory.createBuilder().trustLevel(null).build());
assertThat(serviceKonto.getTrustLevel()).isEqualTo(ServiceKontoMapper.DEFAULT_TRUST_LEVEL);
}
@Test
void shouldContainsTrustLevel() {
var serviceKonto = getServiceKontoFromMappedEingang();
assertThat(serviceKonto.getTrustLevel()).isEqualTo(ServiceKontoTestFactory.TRUST_LEVEL);
}
@DisplayName("postfach address")
@Nested
class TestPostfachAddress {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment