Compare commits
4 Commits
bugfix/fix
...
e0fde434df
| Author | SHA1 | Date | |
|---|---|---|---|
| e0fde434df | |||
| db1d81bcd9 | |||
| 55655a5de2 | |||
| 66be348fd3 |
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
|
Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
|
||||||
|
|
||||||
@ -14,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>de.muehlencord.shared</groupId>
|
<groupId>de.muehlencord.shared</groupId>
|
||||||
@ -36,7 +36,7 @@ limitations under the License.
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,8 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>de.muehlencord.shared</groupId>
|
<groupId>de.muehlencord.shared</groupId>
|
||||||
@ -60,7 +61,7 @@ limitations under the License.
|
|||||||
<!-- Testing -->
|
<!-- Testing -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
@ -27,14 +27,13 @@ limitations under the License.
|
|||||||
<groupId>de.muehlencord</groupId>
|
<groupId>de.muehlencord</groupId>
|
||||||
<version>2.0.1-SNAPSHOT</version>
|
<version>2.0.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<url>http://maven.apache.org</url>
|
<url>http://maven.apache.org</url>
|
||||||
|
|
||||||
<version>2.0.1-SNAPSHOT</version>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -63,16 +62,10 @@ limitations under the License.
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<artifactId>jaxws-api</artifactId>
|
|
||||||
<groupId>javax.xml.ws</groupId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Test -->
|
<!-- Test -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -82,7 +75,4 @@ limitations under the License.
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<finalName>${project.artifactId}</finalName>
|
|
||||||
</build>
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -22,17 +22,16 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.Disabled;
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;k
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Joern Muehlencord (joern@muehlencord.de)
|
* @author Joern Muehlencord (joern@muehlencord.de)
|
||||||
*/
|
*/
|
||||||
public class HttpLayerTest extends BaseTest {
|
class HttpLayerTest extends BaseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@Disabled
|
||||||
public void testPostByMap() throws Exception {
|
void testPostByMap() throws Exception {
|
||||||
System.out.println("testPostByMap");
|
System.out.println("testPostByMap");
|
||||||
Map<String, String[]> map = new HashMap<>();
|
Map<String, String[]> map = new HashMap<>();
|
||||||
String[] value = { "Hello World!", "Hello World again" };
|
String[] value = { "Hello World!", "Hello World again" };
|
||||||
@ -44,7 +43,7 @@ public class HttpLayerTest extends BaseTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@Disabled
|
||||||
public void testPostByMapList() throws Exception {
|
void testPostByMapList() throws Exception {
|
||||||
System.out.println("testPostByMapList");
|
System.out.println("testPostByMapList");
|
||||||
List<Map<String, String[]>> list = new LinkedList<>();
|
List<Map<String, String[]>> list = new LinkedList<>();
|
||||||
Map<String, String[]> map = new HashMap<>();
|
Map<String, String[]> map = new HashMap<>();
|
||||||
@ -62,14 +61,14 @@ public class HttpLayerTest extends BaseTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@Disabled
|
||||||
public void testByValue() throws Exception {
|
void testByValue() throws Exception {
|
||||||
System.out.println("testByValue");
|
System.out.println("testByValue");
|
||||||
HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener");
|
HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener");
|
||||||
httpLayer.post("message", "Hello World by single parameter");
|
httpLayer.post("message", "Hello World by single parameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWithUnknownURL() throws MessageNotSendException {
|
void testWithUnknownURL() throws MessageNotSendException {
|
||||||
System.out.println("testWithUnknownURL");
|
System.out.println("testWithUnknownURL");
|
||||||
HttpLayer httpLayer = new HttpLayer("http://localhost/thisURLDoesNotExist");
|
HttpLayer httpLayer = new HttpLayer("http://localhost/thisURLDoesNotExist");
|
||||||
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
||||||
@ -79,7 +78,7 @@ public class HttpLayerTest extends BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInvalidURL() throws MessageNotSendException {
|
void testInvalidURL() throws MessageNotSendException {
|
||||||
System.out.println("testInvalidURL");
|
System.out.println("testInvalidURL");
|
||||||
HttpLayer httpLayer = new HttpLayer("joern@muehlencord.de");
|
HttpLayer httpLayer = new HttpLayer("joern@muehlencord.de");
|
||||||
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
||||||
@ -88,7 +87,7 @@ public class HttpLayerTest extends BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnsupportedURL() throws MessageNotSendException {
|
void testUnsupportedURL() throws MessageNotSendException {
|
||||||
System.out.println("testUnsupportedURL");
|
System.out.println("testUnsupportedURL");
|
||||||
HttpLayer httpLayer = new HttpLayer("ftp://localhost");
|
HttpLayer httpLayer = new HttpLayer("ftp://localhost");
|
||||||
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
||||||
|
|||||||
104
pom.xml
104
pom.xml
@ -87,36 +87,40 @@ limitations under the License.
|
|||||||
<maven.compiler.release>17</maven.compiler.release>
|
<maven.compiler.release>17</maven.compiler.release>
|
||||||
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<slf4j.version>2.0.9</slf4j.version>
|
<slf4j.version>2.0.12</slf4j.version>
|
||||||
<jackson.version>2.18.1</jackson.version>
|
<jackson.version>2.16.1</jackson.version>
|
||||||
<lombok.version>1.18.34</lombok.version>
|
<lombok.version>1.18.30</lombok.version>
|
||||||
<junit.version>5.11.3</junit.version>
|
<junit.version>5.10.2</junit.version>
|
||||||
|
|
||||||
<poi.version>5.3.0</poi.version>
|
<poi.version>5.2.5</poi.version>
|
||||||
<commons-net.version>3.11.1</commons-net.version>
|
<commons-net.version>3.10.0</commons-net.version>
|
||||||
<commons-lang.version>3.17.0</commons-lang.version>
|
<commons-lang.version>3.14.0</commons-lang.version>
|
||||||
<gson.version>2.11.0</gson.version>
|
<gson.version>2.10.1</gson.version>
|
||||||
<fusionauth.version>5.3.3</fusionauth.version>
|
<fusionauth.version>5.3.1</fusionauth.version>
|
||||||
<bouncycastle.version>1.70</bouncycastle.version>
|
<bouncycastle.version>1.70</bouncycastle.version>
|
||||||
<hibernate.version>7.0.0.Beta1</hibernate.version>
|
<hibernate.version>6.1.7.Final</hibernate.version>
|
||||||
<jakarta.mail.version>2.1.3</jakarta.mail.version>
|
<jakarta.mail-api.version>2.1.2</jakarta.mail-api.version>
|
||||||
|
<ews-java-api.version>2.0</ews-java-api.version>
|
||||||
|
<scrypt.version>1.4.0</scrypt.version>
|
||||||
|
|
||||||
<jakarta-faces.version>4.1.1</jakarta-faces.version>
|
<jakarta-faces.version>4.0.5</jakarta-faces.version>
|
||||||
<joinfaces.version>5.3.5</joinfaces.version>
|
<joinfaces.version>5.1.8</joinfaces.version>
|
||||||
<jakarta.interceptor-api.version>2.2.0</jakarta.interceptor-api.version>
|
<jakarta.interceptor-api.version>2.1.0</jakarta.interceptor-api.version>
|
||||||
<jakarta-inject-api.version>2.0.1</jakarta-inject-api.version>
|
<jakarta-inject-api.version>2.0.1</jakarta-inject-api.version>
|
||||||
<jaxws-api.version>2.3.1</jaxws-api.version>
|
|
||||||
|
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
|
||||||
|
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
|
||||||
|
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
|
||||||
|
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
|
||||||
|
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
|
||||||
|
<maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>
|
||||||
|
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
|
||||||
|
<license-maven-plugin.version>1.14</license-maven-plugin.version>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.joinfaces</groupId>
|
|
||||||
<artifactId>joinfaces-bom</artifactId>
|
|
||||||
<version>${joinfaces.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.joinfaces</groupId>
|
<groupId>org.joinfaces</groupId>
|
||||||
<artifactId>joinfaces-dependencies</artifactId>
|
<artifactId>joinfaces-dependencies</artifactId>
|
||||||
@ -174,12 +178,13 @@ limitations under the License.
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.mail</groupId>
|
<groupId>jakarta.mail</groupId>
|
||||||
<artifactId>jakarta.mail-api</artifactId>
|
<artifactId>jakarta.mail-api</artifactId>
|
||||||
<version>${jakarta.mail.version}</version>
|
<version>${jakarta.mail-api.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>ews-java-api</artifactId>
|
<artifactId>ews-java-api</artifactId>
|
||||||
<groupId>com.microsoft.ews-java-api</groupId>
|
<groupId>com.microsoft.ews-java-api</groupId>
|
||||||
<version>2.0</version>
|
<version>${ews-java-api.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Faces -->
|
<!-- Faces -->
|
||||||
@ -222,16 +227,11 @@ limitations under the License.
|
|||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<version>${jackson.version}</version>
|
<version>${jackson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<artifactId>jaxws-api</artifactId>
|
|
||||||
<groupId>javax.xml.ws</groupId>
|
|
||||||
<version>${jaxws-api.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>scrypt</artifactId>
|
<artifactId>scrypt</artifactId>
|
||||||
<groupId>com.lambdaworks</groupId>
|
<groupId>com.lambdaworks</groupId>
|
||||||
<version>1.4.0</version>
|
<version>${scrypt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
@ -279,17 +279,17 @@ limitations under the License.
|
|||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!-- deploy artifacts to maven repository -->
|
<!-- deploy artifacts to maven repository -->
|
||||||
<!-- <plugin>-->
|
<plugin>
|
||||||
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
|
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||||
<!-- <configuration>-->
|
<configuration>
|
||||||
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
|
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
||||||
<!-- <nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
|
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
||||||
<!-- <serverId>ossrh</serverId>-->
|
<serverId>ossrh</serverId>
|
||||||
<!-- </configuration>-->
|
</configuration>
|
||||||
<!-- <extensions>true</extensions>-->
|
<extensions>true</extensions>
|
||||||
<!-- <groupId>org.sonatype.plugins</groupId>-->
|
<groupId>org.sonatype.plugins</groupId>
|
||||||
<!-- <version>1.6.8</version>-->
|
<version>${nexus-staging-maven-plugin.version}</version>
|
||||||
<!-- </plugin>-->
|
</plugin>
|
||||||
|
|
||||||
<!-- ensure sources are build so they are also uploaded -->
|
<!-- ensure sources are build so they are also uploaded -->
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -318,7 +318,7 @@ limitations under the License.
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<version>3.1.1</version>
|
<version>${maven-javadoc-plugin.version}</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- create license file -->
|
<!-- create license file -->
|
||||||
@ -342,7 +342,7 @@ limitations under the License.
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<version>1.14</version>
|
<version>${license-maven-plugin.version}</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- sign jar archives -->
|
<!-- sign jar archives -->
|
||||||
@ -361,7 +361,7 @@ limitations under the License.
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<version>1.6</version>
|
<version>${maven-gpg-plugin.version}</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
@ -381,27 +381,20 @@ limitations under the License.
|
|||||||
<target>${maven.compiler.target}</target>
|
<target>${maven.compiler.target}</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<version>3.8.1</version>
|
<version>${maven-compiler-plugin.version}</version>
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- build maven ejb artifacts -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-ejb-plugin</artifactId>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- create new releases -->
|
<!-- create new releases -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
<artifactId>maven-release-plugin</artifactId>
|
||||||
<version>2.5.3</version>
|
<version>${maven-release-plugin.version}</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- control junit tests from maven build -->
|
<!-- control junit tests from maven build -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<version>2.22.2</version>
|
<version>${maven-surefire-plugin.version}</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
@ -418,7 +411,6 @@ limitations under the License.
|
|||||||
<configuration>
|
<configuration>
|
||||||
<tagNameFormat>v@{project.version}</tagNameFormat>
|
<tagNameFormat>v@{project.version}</tagNameFormat>
|
||||||
</configuration>
|
</configuration>
|
||||||
<version>2.5.3</version>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@ -428,7 +420,7 @@ limitations under the License.
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<version>3.6.1</version>
|
<version>${maven-dependency-plugin.version}</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
|
Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
|
||||||
|
|
||||||
@ -14,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>de.muehlencord.shared</groupId>
|
<groupId>de.muehlencord.shared</groupId>
|
||||||
@ -38,7 +38,7 @@ limitations under the License.
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -15,18 +15,19 @@
|
|||||||
*/
|
*/
|
||||||
package de.muehlencord.shared.util;
|
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 java.security.SecureRandom;
|
||||||
import org.bouncycastle.util.encoders.Base64;
|
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.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Joern Muehlencord (joern@muehlencord.de)
|
* @author Joern Muehlencord (joern@muehlencord.de)
|
||||||
*/
|
*/
|
||||||
public class PasswordUtilTest {
|
class PasswordUtilTest {
|
||||||
|
|
||||||
private static SecureRandom secureRandom;
|
private static SecureRandom secureRandom;
|
||||||
private static String systemSalt64Coded;
|
private static String systemSalt64Coded;
|
||||||
@ -43,13 +44,13 @@ public class PasswordUtilTest {
|
|||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetHash() {
|
void testGetHash() {
|
||||||
PasswordUtil pwUtil = new PasswordUtil(systemSalt64Coded);
|
PasswordUtil pwUtil = new PasswordUtil(systemSalt64Coded);
|
||||||
|
|
||||||
String password1 = pwUtil.getHash("password");
|
String password1 = pwUtil.getHash("password");
|
||||||
String password2 = pwUtil.getHash("password");
|
String password2 = pwUtil.getHash("password");
|
||||||
|
|
||||||
assertFalse (password1.equals(password2));
|
assertNotEquals(password1, password2);
|
||||||
assertTrue(pwUtil.matches("password", password1));
|
assertTrue(pwUtil.matches("password", password1));
|
||||||
assertFalse(pwUtil.matches("wrongpassword", password1));
|
assertFalse(pwUtil.matches("wrongpassword", password1));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user