Skip to content
Snippets Groups Projects
Commit 67c11c68 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6944 extract string to constant

parent b53ab699
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,8 @@ import lombok.extern.log4j.Log4j2;
@ConditionalOnProperty(AntragraumProperties.PROPERTY_ANTRAGSRAUM_URL)
public class AntragraumService {
private static final String POSTFACH_NACHRICHT = "PostfachNachricht";
static final String BAYERN_ID_SERVICE_KONTO_TYPE = "BAYERN_ID";
static final String USER_NOTIFICATION_TEMPLATE = """
......@@ -233,21 +235,21 @@ public class AntragraumService {
void verifyPostfachId(String samlToken, PostfachNachricht nachricht, Vorgang vorgang) {
if (!StringUtils.equals(vorgang.getPostfachId(), getPostfachId(samlToken))) {
LOG.info("PostfachId in token is not matching postfachId in vorgang.");
throw new NotFoundException(GenericId.from(nachricht.getId()), "PostfachNachricht");
throw new NotFoundException(GenericId.from(nachricht.getId()), POSTFACH_NACHRICHT);
}
}
void verifyTrustLevel(String token, PostfachNachricht nachricht, Vorgang vorgang) {
if (!isAccessible(token, vorgang.getTrustLevel())) {
LOG.info("Trustlevel in token is not great enough to access vorgang.");
throw new NotFoundException(GenericId.from(nachricht.getId()), "PostfachNachricht");
throw new NotFoundException(GenericId.from(nachricht.getId()), POSTFACH_NACHRICHT);
}
}
void verifyFileId(String fileId, PostfachNachricht nachricht) {
if (!nachricht.getAttachments().contains(fileId)) {
LOG.info("FileId is not present in attachment list of PostfachNachricht");
throw new NotFoundException(GenericId.from(nachricht.getId()), "PostfachNachricht");
throw new NotFoundException(GenericId.from(nachricht.getId()), POSTFACH_NACHRICHT);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment