Skip to content

Commit

Permalink
Fix spotless issues
Browse files Browse the repository at this point in the history
Fix spotless issues for build.
  • Loading branch information
slide committed Nov 16, 2024
1 parent cd00349 commit 0aa66bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static String fixupDelimiters(String input) {

// we only need to do more fixup if there are spaces in the string
if (input.contains(" ")) {
if(!input.contains("<") && !input.contains(("("))) {
if (!input.contains("<") && !input.contains(("("))) {

Check warning on line 144 in src/main/java/hudson/plugins/emailext/EmailRecipientUtils.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 144 is only partially covered, one branch is missing
input = input.replace(" ", ", ");
} else {
StringBuilder builder = new StringBuilder(input);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package hudson.plugins.emailext;

import jakarta.mail.internet.InternetAddress;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

import jakarta.mail.internet.InternetAddress;
import org.junit.Test;

public class EmailRecipientUtilsTest {
@Test
public void testFixupDelimiters() throws Exception {
Expand All @@ -17,7 +17,8 @@ public void testFixupDelimiters() throws Exception {
assertEquals("Name Surname", addresses[0].getPersonal());
assertEquals("n.Surname@mymail.com", addresses[0].getAddress());

output = EmailRecipientUtils.fixupDelimiters("user0, user1@email.com User Two <user2@email.com> user3@email.com ");
output = EmailRecipientUtils.fixupDelimiters(
"user0, user1@email.com User Two <user2@email.com> user3@email.com ");
assertEquals("user0, user1@email.com, User Two <user2@email.com>, user3@email.com", output);
addresses = InternetAddress.parse(output);
assertEquals(4, addresses.length);
Expand Down

0 comments on commit 0aa66bc

Please sign in to comment.