diff --git a/configuration/pom.xml b/configuration/pom.xml index 8af4794..63353b2 100644 --- a/configuration/pom.xml +++ b/configuration/pom.xml @@ -1,4 +1,3 @@ - - - 4.0.0 + + 4.0.0 - de.muehlencord.shared - shared-configuration - jar - - - shared - de.muehlencord - 2.0.1-SNAPSHOT - + de.muehlencord.shared + shared-configuration + jar - shared-configuration - http://maven.apache.org - - UTF-8 - + + shared + de.muehlencord + 2.0.1-SNAPSHOT + - - - org.junit.jupiter - junit-jupiter-engine - test - - - - org.slf4j - slf4j-api - provided - - + shared-configuration + http://maven.apache.org + + UTF-8 + + + + + org.junit.jupiter + junit-jupiter-api + test + + + + org.slf4j + slf4j-api + provided + + diff --git a/db/pom.xml b/db/pom.xml index d8d5001..c4d7d18 100644 --- a/db/pom.xml +++ b/db/pom.xml @@ -15,7 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. --> - + 4.0.0 de.muehlencord.shared @@ -60,7 +61,7 @@ limitations under the License. org.junit.jupiter - junit-jupiter-engine + junit-jupiter-api test diff --git a/network/pom.xml b/network/pom.xml index 474a7b9..a9dde27 100644 --- a/network/pom.xml +++ b/network/pom.xml @@ -27,14 +27,13 @@ limitations under the License. de.muehlencord 2.0.1-SNAPSHOT + UTF-8 http://maven.apache.org - 2.0.1-SNAPSHOT - @@ -49,8 +48,8 @@ limitations under the License. - javax.mail - com.sun.mail + jakarta.mail + jakarta.mail-api ews-java-api @@ -63,16 +62,10 @@ limitations under the License. compile - - jaxws-api - javax.xml.ws - test - - - junit-jupiter-engine org.junit.jupiter + junit-jupiter-api test @@ -82,7 +75,4 @@ limitations under the License. - - ${project.artifactId} - diff --git a/network/src/main/java/de/muehlencord/shared/network/mail/DefaultMailReader.java b/network/src/main/java/de/muehlencord/shared/network/mail/DefaultMailReader.java index 93f1912..5ad0e4d 100644 --- a/network/src/main/java/de/muehlencord/shared/network/mail/DefaultMailReader.java +++ b/network/src/main/java/de/muehlencord/shared/network/mail/DefaultMailReader.java @@ -16,20 +16,20 @@ package de.muehlencord.shared.network.mail; import de.muehlencord.shared.util.StringUtil; +import jakarta.mail.Flags; +import jakarta.mail.Folder; +import jakarta.mail.Message; +import jakarta.mail.MessagingException; +import jakarta.mail.Session; +import jakarta.mail.Store; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.search.MessageIDTerm; +import jakarta.mail.search.SearchTerm; +import jakarta.mail.util.SharedByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.LinkedList; import java.util.List; import java.util.Properties; -import javax.mail.Flags; -import javax.mail.Folder; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.Session; -import javax.mail.Store; -import javax.mail.internet.MimeMessage; -import javax.mail.search.MessageIDTerm; -import javax.mail.search.SearchTerm; -import javax.mail.util.SharedByteArrayInputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/network/src/main/java/de/muehlencord/shared/network/mail/MailMessage.java b/network/src/main/java/de/muehlencord/shared/network/mail/MailMessage.java index 8396d5f..edf7bd1 100644 --- a/network/src/main/java/de/muehlencord/shared/network/mail/MailMessage.java +++ b/network/src/main/java/de/muehlencord/shared/network/mail/MailMessage.java @@ -15,12 +15,12 @@ */ package de.muehlencord.shared.network.mail; +import jakarta.mail.Address; +import jakarta.mail.internet.InternetAddress; import java.util.ArrayList; import java.util.Date; import java.util.LinkedList; import java.util.List; -import javax.mail.Address; -import javax.mail.internet.InternetAddress; /** * A mail message diff --git a/network/src/main/java/de/muehlencord/shared/network/mail/MailMessageUtils.java b/network/src/main/java/de/muehlencord/shared/network/mail/MailMessageUtils.java index cd98c60..5185b65 100644 --- a/network/src/main/java/de/muehlencord/shared/network/mail/MailMessageUtils.java +++ b/network/src/main/java/de/muehlencord/shared/network/mail/MailMessageUtils.java @@ -16,18 +16,19 @@ package de.muehlencord.shared.network.mail; import static de.muehlencord.shared.util.StringUtil.getStackTraceString; + +import jakarta.mail.BodyPart; +import jakarta.mail.Message; +import jakarta.mail.MessagingException; +import jakarta.mail.Multipart; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeMultipart; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; import java.util.Locale; -import javax.mail.BodyPart; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.Multipart; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/network/src/main/java/de/muehlencord/shared/network/mail/imap/ImapMailReader.java b/network/src/main/java/de/muehlencord/shared/network/mail/imap/ImapMailReader.java index fc18ee1..301671b 100644 --- a/network/src/main/java/de/muehlencord/shared/network/mail/imap/ImapMailReader.java +++ b/network/src/main/java/de/muehlencord/shared/network/mail/imap/ImapMailReader.java @@ -19,7 +19,7 @@ import de.muehlencord.shared.network.mail.DefaultMailReader; import de.muehlencord.shared.network.mail.MailProtocol; import de.muehlencord.shared.network.mail.MailReaderConfiguration; import de.muehlencord.shared.network.mail.MailReaderConnectionException; -import javax.mail.Session; +import jakarta.mail.Session; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/network/src/test/java/de/muehlencord/shared/network/http/HttpLayerTest.java b/network/src/test/java/de/muehlencord/shared/network/http/HttpLayerTest.java index edf3bec..0ffb4a5 100644 --- a/network/src/test/java/de/muehlencord/shared/network/http/HttpLayerTest.java +++ b/network/src/test/java/de/muehlencord/shared/network/http/HttpLayerTest.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,74 +25,73 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** - * * @author Joern Muehlencord (joern@muehlencord.de) */ -public class HttpLayerTest extends BaseTest { +class HttpLayerTest extends BaseTest { - @Test - @Disabled - public void testPostByMap() throws Exception { - System.out.println("testPostByMap"); - Map map = new HashMap<>(); - String[] value = {"Hello World!", "Hello World again"}; - map.put("message", value); + @Test + @Disabled + void testPostByMap() throws Exception { + System.out.println("testPostByMap"); + Map map = new HashMap<>(); + String[] value = { "Hello World!", "Hello World again" }; + map.put("message", value); - HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener"); - httpLayer.post(map); - } + HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener"); + httpLayer.post(map); + } - @Test - @Disabled - public void testPostByMapList() throws Exception { - System.out.println("testPostByMapList"); - List> list = new LinkedList<>(); - Map map = new HashMap<>(); - String[] value = {"Hello World!", "Hello World again"}; - map.put("message", value); - list.add(map); - map = new HashMap<>(); - String[] urlValue = {"http://localhost:8080/testurl"}; - map.put("url", urlValue); - list.add(map); + @Test + @Disabled + void testPostByMapList() throws Exception { + System.out.println("testPostByMapList"); + List> list = new LinkedList<>(); + Map map = new HashMap<>(); + String[] value = { "Hello World!", "Hello World again" }; + map.put("message", value); + list.add(map); + map = new HashMap<>(); + String[] urlValue = { "http://localhost:8080/testurl" }; + map.put("url", urlValue); + list.add(map); - HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener"); - httpLayer.post(list); - } + HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener"); + httpLayer.post(list); + } - @Test - @Disabled - public void testByValue() throws Exception { - System.out.println("testByValue"); - HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener"); - httpLayer.post("message", "Hello World by single parameter"); - } + @Test + @Disabled + void testByValue() throws Exception { + System.out.println("testByValue"); + HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener"); + httpLayer.post("message", "Hello World by single parameter"); + } - @Test - public void testWithUnknownURL() throws MessageNotSendException { - System.out.println("testWithUnknownURL"); - HttpLayer httpLayer = new HttpLayer("http://localhost/thisURLDoesNotExist"); - Assertions.assertThrows(MessageNotSendException.class, () -> { - httpLayer.post("message", "Hello World by single parameter"); - }); + @Test + void testWithUnknownURL() throws MessageNotSendException { + System.out.println("testWithUnknownURL"); + HttpLayer httpLayer = new HttpLayer("http://localhost/thisURLDoesNotExist"); + Assertions.assertThrows(MessageNotSendException.class, () -> { + httpLayer.post("message", "Hello World by single parameter"); + }); - } + } - @Test - public void testInvalidURL() throws MessageNotSendException { - System.out.println("testInvalidURL"); - HttpLayer httpLayer = new HttpLayer("joern@muehlencord.de"); - Assertions.assertThrows(MessageNotSendException.class, () -> { - httpLayer.post("message", "Hello World by single parameter"); - }); - } + @Test + void testInvalidURL() throws MessageNotSendException { + System.out.println("testInvalidURL"); + HttpLayer httpLayer = new HttpLayer("joern@muehlencord.de"); + Assertions.assertThrows(MessageNotSendException.class, () -> { + httpLayer.post("message", "Hello World by single parameter"); + }); + } - @Test - public void testUnsupportedURL() throws MessageNotSendException { - System.out.println("testUnsupportedURL"); - HttpLayer httpLayer = new HttpLayer("ftp://localhost"); - Assertions.assertThrows(MessageNotSendException.class, () -> { - httpLayer.post("message", "Hello World by single parameter"); - }); - } + @Test + void testUnsupportedURL() throws MessageNotSendException { + System.out.println("testUnsupportedURL"); + HttpLayer httpLayer = new HttpLayer("ftp://localhost"); + Assertions.assertThrows(MessageNotSendException.class, () -> { + httpLayer.post("message", "Hello World by single parameter"); + }); + } } diff --git a/network/src/test/java/de/muehlencord/shared/network/mail/TestSendMail.java b/network/src/test/java/de/muehlencord/shared/network/mail/TestSendMail.java index 3cebecf..5d8ed62 100644 --- a/network/src/test/java/de/muehlencord/shared/network/mail/TestSendMail.java +++ b/network/src/test/java/de/muehlencord/shared/network/mail/TestSendMail.java @@ -15,6 +15,19 @@ */ package de.muehlencord.shared.network.mail; +import static org.junit.jupiter.api.Assumptions.assumeFalse; + +import jakarta.mail.Message; +import jakarta.mail.MessagingException; +import jakarta.mail.Multipart; +import jakarta.mail.PasswordAuthentication; +import jakarta.mail.Session; +import jakarta.mail.Transport; +import jakarta.mail.internet.AddressException; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeBodyPart; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeMultipart; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -22,18 +35,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Properties; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.Multipart; -import javax.mail.PasswordAuthentication; -import javax.mail.Session; -import javax.mail.Transport; -import javax.mail.internet.AddressException; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeBodyPart; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,7 +64,7 @@ public class TestSendMail { props.put("mail.smtp.port", "587"); props.put("mail.debug", "true"); - Session mailSession = Session.getInstance(props, new javax.mail.Authenticator() { + Session mailSession = Session.getInstance(props, new jakarta.mail.Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(RECEIVER, PASSWORD); diff --git a/pom.xml b/pom.xml index 08d5278..6669609 100644 --- a/pom.xml +++ b/pom.xml @@ -87,10 +87,10 @@ limitations under the License. 17 UTF-8 - 2.0.9 - 2.16.0 + 2.0.12 + 2.16.1 1.18.30 - 5.10.1 + 5.10.2 5.2.5 3.10.0 @@ -98,14 +98,25 @@ limitations under the License. 2.10.1 5.3.1 1.70 - 6.2.15.Final - 1.6.2 + 6.1.7.Final + 2.1.2 + 2.0 + 1.4.0 4.0.5 - 5.1.6 + 5.1.8 2.1.0 2.0.1 - 2.3.1 + + 3.1.1 + 1.6 + 3.8.1 + 2.5.3 + 2.22.2 + 3.6.1 + 1.6.8 + 1.14 + @@ -165,14 +176,15 @@ limitations under the License. - javax.mail - com.sun.mail - ${com-sun-mail.version} + jakarta.mail + jakarta.mail-api + ${jakarta.mail-api.version} + ews-java-api com.microsoft.ews-java-api - 2.0 + ${ews-java-api.version} @@ -215,16 +227,11 @@ limitations under the License. com.fasterxml.jackson.datatype ${jackson.version} - - jaxws-api - javax.xml.ws - ${jaxws-api.version} - scrypt com.lambdaworks - 1.4.0 + ${scrypt.version} bcprov-jdk15on @@ -272,17 +279,17 @@ limitations under the License. - - - - - - - - - - - + + nexus-staging-maven-plugin + + true + https://oss.sonatype.org/ + ossrh + + true + org.sonatype.plugins + ${nexus-staging-maven-plugin.version} + @@ -311,7 +318,7 @@ limitations under the License. org.apache.maven.plugins - 3.1.1 + ${maven-javadoc-plugin.version} @@ -335,7 +342,7 @@ limitations under the License. org.codehaus.mojo - 1.14 + ${license-maven-plugin.version} @@ -354,7 +361,7 @@ limitations under the License. org.apache.maven.plugins - 1.6 + ${maven-gpg-plugin.version} @@ -374,27 +381,20 @@ limitations under the License. ${maven.compiler.target} org.apache.maven.plugins - 3.8.1 - - - - - maven-ejb-plugin - org.apache.maven.plugins - 3.0.1 + ${maven-compiler-plugin.version} maven-release-plugin - 2.5.3 + ${maven-release-plugin.version} maven-surefire-plugin org.apache.maven.plugins - 2.22.2 + ${maven-surefire-plugin.version} @@ -411,7 +411,6 @@ limitations under the License. v@{project.version} - 2.5.3 org.apache.maven.plugins @@ -421,7 +420,7 @@ limitations under the License. org.apache.maven.plugins maven-dependency-plugin - 3.6.1 + ${maven-dependency-plugin.version} diff --git a/util/pom.xml b/util/pom.xml index a6ba942..eb91721 100644 --- a/util/pom.xml +++ b/util/pom.xml @@ -1,4 +1,3 @@ - - - 4.0.0 + + 4.0.0 - de.muehlencord.shared - shared-util - jar - - shared-util - - - shared - de.muehlencord - 2.0.1-SNAPSHOT - - - - http://maven.apache.org - - UTF-8 - + de.muehlencord.shared + shared-util + jar - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.slf4j - slf4j-api - provided - - - org.bouncycastle - bcprov-jdk15on - - + shared-util + + + shared + de.muehlencord + 2.0.1-SNAPSHOT + + + + http://maven.apache.org + + UTF-8 + + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.slf4j + slf4j-api + provided + + + org.bouncycastle + bcprov-jdk15on + + diff --git a/util/src/test/java/de/muehlencord/shared/util/PasswordUtilTest.java b/util/src/test/java/de/muehlencord/shared/util/PasswordUtilTest.java index e2d33bc..fda3c05 100644 --- a/util/src/test/java/de/muehlencord/shared/util/PasswordUtilTest.java +++ b/util/src/test/java/de/muehlencord/shared/util/PasswordUtilTest.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,45 +15,46 @@ */ package de.muehlencord.shared.util; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.security.SecureRandom; import org.bouncycastle.util.encoders.Base64; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; /** - * * @author Joern Muehlencord (joern@muehlencord.de) */ -public class PasswordUtilTest { - - private static SecureRandom secureRandom; - private static String systemSalt64Coded; - private static byte[] systemSaltBytes; - - @BeforeAll - public static void init() { - secureRandom = new SecureRandom(); - - systemSaltBytes = new byte[32]; - secureRandom.nextBytes (systemSaltBytes); - systemSalt64Coded = new String(Base64.encode (systemSaltBytes)); - } - +class PasswordUtilTest { - @Test - public void testGetHash() { - PasswordUtil pwUtil = new PasswordUtil(systemSalt64Coded); - - String password1 = pwUtil.getHash("password"); - String password2 = pwUtil.getHash("password"); - - assertFalse (password1.equals(password2)); - assertTrue (pwUtil.matches ("password", password1)); - assertFalse (pwUtil.matches ("wrongpassword", password1)); - + private static SecureRandom secureRandom; + private static String systemSalt64Coded; + private static byte[] systemSaltBytes; + + @BeforeAll + public static void init() { + secureRandom = new SecureRandom(); + + systemSaltBytes = new byte[32]; + secureRandom.nextBytes(systemSaltBytes); + systemSalt64Coded = new String(Base64.encode(systemSaltBytes)); + } + + + @Test + void testGetHash() { + PasswordUtil pwUtil = new PasswordUtil(systemSalt64Coded); + + String password1 = pwUtil.getHash("password"); + String password2 = pwUtil.getHash("password"); + + assertNotEquals(password1, password2); + assertTrue(pwUtil.matches("password", password1)); + assertFalse(pwUtil.matches("wrongpassword", password1)); + + + } - } - }