From 6b1c75a0de57abf74688a4f0a4ab6fb33a68ec19 Mon Sep 17 00:00:00 2001 From: Valentyn Grygoriev Date: Mon, 1 Jan 2024 14:44:11 +0200 Subject: [PATCH] Fixed typo in the sechub-notification module. #1139 --- .../src/main/resources/reduced-openapi3.json | 98 +++++++++---------- .../NotificationConfiguration.java | 6 +- .../email/MockEmailRestController.java | 6 +- ...jectHasBeenDeletedNotificationService.java | 12 +-- ...AddressChangedNotificationServiceTest.java | 16 +-- 5 files changed, 69 insertions(+), 69 deletions(-) diff --git a/sechub-api-java/src/main/resources/reduced-openapi3.json b/sechub-api-java/src/main/resources/reduced-openapi3.json index 05bff0085f..3888815e80 100644 --- a/sechub-api-java/src/main/resources/reduced-openapi3.json +++ b/sechub-api-java/src/main/resources/reduced-openapi3.json @@ -2938,6 +2938,55 @@ } } }, + "ExecutionProfileFetch": { + "title": "ExecutionProfileFetch", + "type": "object", + "properties": { + "configurations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "productIdentifier": { + "type": "string", + "description": "executed product" + }, + "name": { + "type": "string", + "description": "name of configuration" + }, + "executorVersion": { + "type": "number", + "description": "executor version" + }, + "uuid": { + "type": "string", + "description": "uuid of configuration" + }, + "enabled": { + "type": "boolean", + "description": "enabled state of this config" + } + } + } + }, + "description": { + "type": "string", + "description": "A short description for the profile" + }, + "projectIds": { + "type": "array", + "description": "Projects can be linked by their ids here", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "description": "Enabled state of profile, default is false" + } + } + }, "FalsePositives": { "title": "FalsePositives", "type": "object", @@ -3051,55 +3100,6 @@ } } }, - "ExecutionProfileFetch": { - "title": "ExecutionProfileFetch", - "type": "object", - "properties": { - "configurations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "productIdentifier": { - "type": "string", - "description": "executed product" - }, - "name": { - "type": "string", - "description": "name of configuration" - }, - "executorVersion": { - "type": "number", - "description": "executor version" - }, - "uuid": { - "type": "string", - "description": "uuid of configuration" - }, - "enabled": { - "type": "boolean", - "description": "enabled state of this config" - } - } - } - }, - "description": { - "type": "string", - "description": "A short description for the profile" - }, - "projectIds": { - "type": "array", - "description": "Projects can be linked by their ids here", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean", - "description": "Enabled state of profile, default is false" - } - } - }, "FullScanDataZIP": { "title": "FullScanDataZIP", "type": "object" diff --git a/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/NotificationConfiguration.java b/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/NotificationConfiguration.java index 8d97bf3f6f..6dfe926721 100644 --- a/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/NotificationConfiguration.java +++ b/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/NotificationConfiguration.java @@ -15,15 +15,15 @@ @Component public class NotificationConfiguration { - @MustBeDocumented(value = "Single mail adress used for emails to administrators. This should an NPM (non personalized mailbox)") + @MustBeDocumented(value = "Single mail address used for emails to administrators. This should an NPM (non personalized mailbox)") @Value("${sechub.notification.email.administrators}") private String emailAdministrators; - @MustBeDocumented(value = "Adress used for emails sent by sechub system") + @MustBeDocumented(value = "Address used for emails sent by sechub system") @Value("${sechub.notification.email.from}") private String emailFrom; - @MustBeDocumented(value = "Adress used for reply when email was sent by sechub system") + @MustBeDocumented(value = "Address used for reply when email was sent by sechub system") @Value("${sechub.notification.email.replyto:}") private String emailReplyTo; diff --git a/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/email/MockEmailRestController.java b/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/email/MockEmailRestController.java index a2a14220cb..dff3fd3099 100644 --- a/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/email/MockEmailRestController.java +++ b/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/email/MockEmailRestController.java @@ -39,13 +39,13 @@ public class MockEmailRestController { /* @formatter:off */ @RequestMapping( - path = APIConstants.API_ANONYMOUS+"integrationtest/mock/emails/to/{emailAdress}", + path = APIConstants.API_ANONYMOUS+"integrationtest/mock/emails/to/{emailAddress}", method = RequestMethod.GET, produces= {MediaType.APPLICATION_JSON_VALUE}) @ResponseStatus(HttpStatus.OK) - public List getMailsFor(@PathVariable(name="emailAdress") String emailAdress) { + public List getMailsFor(@PathVariable(name="emailAddress") String emailAddress) { /* @formatter:on */ - return mockMailService.getMailsFor(emailAdress); + return mockMailService.getMailsFor(emailAddress); } /* @formatter:off */ diff --git a/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/user/InformUsersThatProjectHasBeenDeletedNotificationService.java b/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/user/InformUsersThatProjectHasBeenDeletedNotificationService.java index bf49a11da0..24d5d99a6a 100644 --- a/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/user/InformUsersThatProjectHasBeenDeletedNotificationService.java +++ b/sechub-notification/src/main/java/com/mercedesbenz/sechub/domain/notification/user/InformUsersThatProjectHasBeenDeletedNotificationService.java @@ -32,9 +32,9 @@ public class InformUsersThatProjectHasBeenDeletedNotificationService { public void notify(ProjectMessage projectMessage, String baseUrl) { requireNonNull(projectMessage); - Set mailAdresses = projectMessage.getUserEmailAddresses(); - if (mailAdresses == null || mailAdresses.isEmpty()) { - LOG.info("No users found for project {} so ignore sending info mail about delete", projectMessage.getProjectId()); + Set emailAddresses = projectMessage.getUserEmailAddresses(); + if (emailAddresses == null || emailAddresses.isEmpty()) { + LOG.info("No users found for project {} so ignore sending info email about delete", projectMessage.getProjectId()); return; } SimpleMailMessage message = factory.createMessage("A SecHub project where you have been a user was deleted: " + projectMessage.getProjectId()); @@ -44,10 +44,10 @@ public void notify(ProjectMessage projectMessage, String baseUrl) { emailContent.append("has been deleted.\n\n"); emailContent.append("This means that all report data has been deleted, and thus sechub scans for this project are no longer accessible.\n"); - String[] userAdresses = projectMessage.getUserEmailAddresses().toArray(new String[mailAdresses.size()]); + String[] userAddresses = projectMessage.getUserEmailAddresses().toArray(new String[emailAddresses.size()]); - message.setBcc(userAdresses); // we do send per BCC so users do not get other email addresses. Maybe necessary - // because of data protection + message.setBcc(userAddresses); // we do send per BCC so users do not get other email addresses. Maybe necessary + // because of data protection message.setText(emailContent.toString()); emailService.send(message); diff --git a/sechub-notification/src/test/java/com/mercedesbenz/sechub/domain/notification/user/UserEmailAddressChangedNotificationServiceTest.java b/sechub-notification/src/test/java/com/mercedesbenz/sechub/domain/notification/user/UserEmailAddressChangedNotificationServiceTest.java index b91efa5898..2c55b77112 100644 --- a/sechub-notification/src/test/java/com/mercedesbenz/sechub/domain/notification/user/UserEmailAddressChangedNotificationServiceTest.java +++ b/sechub-notification/src/test/java/com/mercedesbenz/sechub/domain/notification/user/UserEmailAddressChangedNotificationServiceTest.java @@ -35,13 +35,13 @@ void beforeEach() { @Test void sends_emails_to_former_and_new_mail_address_containing_expected_content() { /* prepare */ - String emailAddress = "email.adress@example.org"; - String formerEmailAddress = "former_email.adress@example.org"; + String emailAddress = "email.address@example.org"; + String formerEmailAddress = "former_email.address@example.org"; UserMessage userMessage = new UserMessage(); userMessage.setEmailAddress(emailAddress); userMessage.setFormerEmailAddress(formerEmailAddress); - userMessage.setSubject("Your mail adress has changed by a test"); + userMessage.setSubject("Your mail address has changed by a test"); SimpleMailMessage simpleMailmessageFormer = new SimpleMailMessage(); simpleMailmessageFormer.setSubject(""); @@ -68,18 +68,18 @@ void sends_emails_to_former_and_new_mail_address_containing_expected_content() { String receivedFormerText = mails.receivedFormer.getText(); String receivedNewText = mails.receivedNew.getText(); - assertEquals("Your mail adress has changed by a test and it will not be used any longer for SecHub.\n" + assertEquals("Your mail address has changed by a test and it will not be used any longer for SecHub.\n" + "\n" + "In case you do not receive a follow up notification to the new email address, please inform your SecHub administrator!", receivedFormerText); - assertEquals("Your mail adress has changed by a test from former_email.adress@example.org to email.adress@example.org. \n" + assertEquals("Your mail address has changed by a test from former_email.address@example.org to email.address@example.org. \n" + "Your old email address is not used in SecHub any longer.", receivedNewText); /* @formatter:on */ } - private Mails fetchSentMailsFromMockObjects(String emailAdress, String formerEmailAdress) { + private Mails fetchSentMailsFromMockObjects(String emailAddress, String formerEmailAddress) { ArgumentCaptor messageCaptor = ArgumentCaptor.forClass(SimpleMailMessage.class); verify(emailService, times(2)).send(messageCaptor.capture()); List messagesSent = messageCaptor.getAllValues(); @@ -87,10 +87,10 @@ private Mails fetchSentMailsFromMockObjects(String emailAdress, String formerEma assertEquals(2, messagesSent.size()); Mails data = new Mails(); for (SimpleMailMessage message : messagesSent) { - if (emailAdress.equals(message.getTo()[0])) { + if (emailAddress.equals(message.getTo()[0])) { data.receivedNew = message; } - if (formerEmailAdress.equals(message.getTo()[0])) { + if (formerEmailAddress.equals(message.getTo()[0])) { data.receivedFormer = message; } }