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

OZG-6054 xta: Avoid accidental use of wildcard identifier

parent e093cb5a
Branches
Tags
No related merge requests found
package de.ozgcloud.eingang.xta;
import java.util.Objects;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.ws.client.WebServiceClientException;
......@@ -12,10 +18,6 @@ import eu.osci.ws._2014._10.transport.OriginatorsType;
import eu.osci.ws._2014._10.transport.PartyIdentifierType;
import eu.osci.ws._2014._10.transport.PartyType;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
@Component
class WsHeaderAddingInterceptor implements ClientInterceptor {
......@@ -43,7 +45,10 @@ class WsHeaderAddingInterceptor implements ClientInterceptor {
PartyType partyType = new PartyType();
PartyIdentifierType identifier = new PartyIdentifierType();
identifier.setValue(xtaCurrentIdentifierService.getCurrentIdentifier());
identifier.setValue(Objects.requireNonNull(
xtaCurrentIdentifierService.getCurrentIdentifier(),
"Expect current identifier to be set!")
);
partyType.setIdentifier(identifier);
var origin = new OriginatorsType();
......
......@@ -15,7 +15,7 @@ public class XtaCurrentIdentifierService {
@Setter
@Getter
private String currentIdentifier = "*";
private String currentIdentifier;
@Autowired
@Valid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment