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

OZG-5778 review: renaming

parent 39c8e4f7
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ public class FormMetaDataTestFactory {
public static final String DESTINATION_ID_ENTRY_NAME = "destinationId";
public static final String DESTINATION_ID = "vbe:010550120100";
public static final String XTA_IDENTIFIER = "vbe:010550120100";
public static final String OE_ID = "010550120100";
public static FormMetaData create() {
......@@ -26,7 +26,7 @@ public class FormMetaDataTestFactory {
public String getEntry(String name) {
switch (name) {
case DESTINATION_ID_ENTRY_NAME:
return DESTINATION_ID;
return XTA_IDENTIFIER;
}
return null;
}
......
......@@ -12,12 +12,14 @@ import lombok.NonNull;
@Component
class ZustaendigeStelleMapper implements FimEngineBasedMapper {
static final String DESTINATION_ID_ENTRY_NAME = "destinationId";
static final String XTA_IDENTIFIER_ENTRY_NAME = "xtaIdentifier";
// TODO OZG-7086 umstellen auf FIM Headerdaten
@Override
public FormData parseFormData(FormData formData) {
return formData.getControl().getMetaData()
.map(metaData -> metaData.getEntry(DESTINATION_ID_ENTRY_NAME))
.map(metaData -> metaData.getEntry(XTA_IDENTIFIER_ENTRY_NAME))
.filter(Objects::nonNull)
.map(oeId -> setOrganisationsEinheitId(formData.getZustaendigeStelle(), oeId))
.map(zustStelle -> formData.toBuilder().zustaendigeStelle(zustStelle).build())
......@@ -31,11 +33,11 @@ class ZustaendigeStelleMapper implements FimEngineBasedMapper {
return builder.build();
}
Optional<String> extractOrganisationsEinheitId(@NonNull String destinationId) {
var idx = destinationId.indexOf(":");
Optional<String> extractOrganisationsEinheitId(@NonNull String xtaIdentifier) {
var idx = xtaIdentifier.indexOf(":");
if (idx < 0) {
return Optional.empty();
}
return Optional.of(destinationId.substring(idx + 1));
return Optional.of(xtaIdentifier.substring(idx + 1));
}
}
......@@ -16,7 +16,7 @@ class XtaMessageMetaData implements FormMetaData {
static final String MESSAGE_TYPE_ENTRY_NAME = "messageType";
static final String MESSAGE_TYPE_LIST_VERSION = "messageTypeListVersion";
static final String MESSAGE_ID_ENTRY_NAME = "messageId";
static final String DESTINATION_ID_ENTRY_NAME = "destinationId";
static final String XTA_IDENTIFIER_ENTRY_NAME = "xtaIdentifier";
// MsgIdentification.MessageId
private XtaMessageId messageId;
......@@ -33,7 +33,7 @@ class XtaMessageMetaData implements FormMetaData {
// Qualifier.Service
private String service;
private String destinationId;
private String xtaIdentifier;
private IncomingFile metaDataFile;
......@@ -46,8 +46,8 @@ class XtaMessageMetaData implements FormMetaData {
return getMessageTypeListVersion();
case MESSAGE_ID_ENTRY_NAME:
return getMessageId().toString();
case DESTINATION_ID_ENTRY_NAME:
return getDestinationId();
case XTA_IDENTIFIER_ENTRY_NAME:
return getXtaIdentifier();
case SERVICE:
return getService();
......
......@@ -13,11 +13,14 @@ import eu.osci.ws._2014._10.transport.MessageMetaData;
@Mapper
interface XtaMessageMetaDataMapper {
@Mapping(target = "messageTypeListVersion", ignore = true)
@Mapping(target = "metaDataFile", ignore = true)
@Mapping(target = "service", ignore = true)
@Mapping(target = "origin", source = "deliveryAttributes.origin")
@Mapping(target = "delivery", source = "deliveryAttributes.delivery")
@Mapping(target = "messageId", source = "msgIdentification.messageID.value")
@Mapping(target = "messageType", source = "qualifier.messageType.code")
@Mapping(target = "destinationId", source = "destinations.reader.identifier.value")
@Mapping(target = "xtaIdentifier", source = "destinations.reader.identifier.value")
XtaMessageMetaData fromSoap(MessageMetaData metaData);
default XtaMessageId fromString(String id) {
......
......@@ -93,7 +93,7 @@ class XtaMessageMapperTest {
assertThat(formData.getControl().getMetaData()).isPresent().get()
.extracting(metaData -> metaData.getEntry(FormMetaDataTestFactory.DESTINATION_ID_ENTRY_NAME))
.isEqualTo(FormMetaDataTestFactory.DESTINATION_ID);
.isEqualTo(FormMetaDataTestFactory.XTA_IDENTIFIER);
}
private FormData doMapping() {
......
......@@ -24,7 +24,7 @@ class XtaMessageMetaDataTestFactory {
.messageType(MESSAGE_TYPE)
.messageTypeListVersion(MESSAGE_TYPE_LIST_VERSION)
.origin(ORIGIN)
.destinationId(FormMetaDataTestFactory.DESTINATION_ID)
.xtaIdentifier(FormMetaDataTestFactory.XTA_IDENTIFIER)
.service(SERVICE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment