Merge remote-tracking branch 'origin/JAVA-8279-Split-or-move-core-java-module' into JAVA-8279-Split-or-move-core-java-module

This commit is contained in:
mikr 2021-11-14 23:02:18 +01:00
commit cd162c3f89
196 changed files with 1454 additions and 1118 deletions

View File

@ -41,4 +41,4 @@
<akka.stream.version>2.5.11</akka.stream.version>
</properties>
</project>
</project>

View File

@ -63,7 +63,8 @@
<artifactId>json-simple</artifactId>
<version>${json-simple.version}</version>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine
included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<dependencies>

View File

@ -13,7 +13,6 @@
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<dependencies>

View File

@ -13,7 +13,6 @@
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<dependencies>

View File

@ -14,7 +14,6 @@
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<dependencies>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<dependencies>

View File

@ -38,37 +38,37 @@
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>${maven.compiler.release}</release>
<compilerArgs>--enable-preview</compilerArgs>
<compilerArgs>--enable-preview</compilerArgs>
<source>${maven.compiler.source.version}</source>
<target>${maven.compiler.target.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.plugin.version}</version>
<configuration>
<argLine>--enable-preview</argLine>
<forkCount>1</forkCount>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-api</artifactId>
<version>${surefire.plugin.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.plugin.version}</version>
<configuration>
<argLine>--enable-preview</argLine>
<forkCount>1</forkCount>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-api</artifactId>
<version>${surefire.plugin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source.version>16</maven.compiler.source.version>
<maven.compiler.target.version>16</maven.compiler.target.version>
<maven.compiler.release>16</maven.compiler.release>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<surefire.plugin.version>3.0.0-M5</surefire.plugin.version>
<assertj.version>3.17.2</assertj.version>
<maven.compiler.release>16</maven.compiler.release>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<surefire.plugin.version>3.0.0-M5</surefire.plugin.version>
<assertj.version>3.17.2</assertj.version>
</properties>
</project>

View File

@ -42,13 +42,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.plugin.version}</version>
<configuration>
<argLine>--enable-preview</argLine>
<argLine>--enable-native-access=core.java</argLine>
<forkCount>1</forkCount>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
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">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-annotations</artifactId>
<version>0.1.0-SNAPSHOT</version>
@ -37,4 +37,4 @@
</resources>
</build>
</project>
</project>

View File

@ -19,20 +19,17 @@
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -4,6 +4,7 @@ This module contains articles about core Java input/output(IO) conversions.
### Relevant Articles:
- [Java InputStream to String](https://www.baeldung.com/convert-input-stream-to-string)
- [Java String to InputStream](https://www.baeldung.com/convert-string-to-input-stream)
- [Java Write an InputStream to a File](https://www.baeldung.com/convert-input-stream-to-a-file)
- [Converting a BufferedReader to a JSONObject](https://www.baeldung.com/java-bufferedreader-to-jsonobject)
- [Reading a CSV File into an Array](https://www.baeldung.com/java-csv-file-array)

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -0,0 +1,44 @@
package com.baeldung.stringtoinputstream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.io.CharSource;
public class JavaXToInputStreamUnitTest {
protected final Logger logger = LoggerFactory.getLogger(getClass());
// tests - String - InputStream
@Test
public final void givenUsingPlainJava_whenConvertingStringToInputStream_thenCorrect() throws IOException {
final String initialString = "text";
final InputStream targetStream = new ByteArrayInputStream(initialString.getBytes());
IOUtils.closeQuietly(targetStream);
}
@Test
public final void givenUsingGuava_whenConvertingStringToInputStream_thenCorrect() throws IOException {
final String initialString = "text";
final InputStream targetStream = CharSource.wrap(initialString).asByteSource(StandardCharsets.UTF_8).openStream();
IOUtils.closeQuietly(targetStream);
}
@Test
public final void givenUsingCommonsIO_whenConvertingStringToInputStream_thenCorrect() throws IOException {
final String initialString = "text";
final InputStream targetStream = IOUtils.toInputStream(initialString);
IOUtils.closeQuietly(targetStream);
}
}

View File

@ -13,5 +13,4 @@ This module contains articles about core Java input/output(IO) conversions.
- [Java Write a Reader to File](https://www.baeldung.com/java-write-reader-to-file)
- [Java Reader to Byte Array](https://www.baeldung.com/java-convert-reader-to-byte-array)
- [Java Reader to InputStream](https://www.baeldung.com/java-convert-reader-to-inputstream)
- [Java String to InputStream](https://www.baeldung.com/convert-string-to-input-stream)
- More articles: [[next -->]](/core-java-modules/core-java-io-conversions-2)

View File

@ -1,46 +1,25 @@
package com.baeldung.filetoinputstream;
import com.google.common.io.ByteSource;
import com.google.common.io.CharSource;
import com.google.common.io.Files;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.SequenceInputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.nio.charset.StandardCharsets;
import com.google.common.io.ByteSource;
import com.google.common.io.Files;
public class JavaXToInputStreamUnitTest {
protected final Logger logger = LoggerFactory.getLogger(getClass());
// tests - String - InputStream
@Test
public final void givenUsingPlainJava_whenConvertingStringToInputStream_thenCorrect() throws IOException {
final String initialString = "text";
final InputStream targetStream = new ByteArrayInputStream(initialString.getBytes());
IOUtils.closeQuietly(targetStream);
}
@Test
public final void givenUsingGuava_whenConvertingStringToInputStream_thenCorrect() throws IOException {
final String initialString = "text";
final InputStream targetStream = CharSource.wrap(initialString).asByteSource(StandardCharsets.UTF_8).openStream();
IOUtils.closeQuietly(targetStream);
}
@Test
public final void givenUsingCommonsIO_whenConvertingStringToInputStream_thenCorrect() throws IOException {
final String initialString = "text";
final InputStream targetStream = IOUtils.toInputStream(initialString);
IOUtils.closeQuietly(targetStream);
}
// byte array - InputStream
@Test

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -1,19 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-os</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>core-java-os</name>
<packaging>jar</packaging>
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">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-os</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>core-java-os</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
@ -55,39 +54,39 @@
</dependency>
</dependencies>
<build>
<finalName>core-java-os</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</build>
<build>
<finalName>core-java-os</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<!-- util -->
<commons-collections4.version>4.1</commons-collections4.version>
<collections-generic.version>4.01</collections-generic.version>
<!-- testing -->
<assertj.version>3.6.1</assertj.version>
<asspectj.version>1.8.9</asspectj.version>
<maven.compiler.source>1.9</maven.compiler.source>
<maven.compiler.target>1.9</maven.compiler.target>
<guava.version>25.1-jre</guava.version>
<unix4j.version>0.4</unix4j.version>
<grep4j.version>1.8.7</grep4j.version>
</properties>
<properties>
<!-- util -->
<commons-collections4.version>4.1</commons-collections4.version>
<collections-generic.version>4.01</collections-generic.version>
<!-- testing -->
<assertj.version>3.6.1</assertj.version>
<asspectj.version>1.8.9</asspectj.version>
<maven.compiler.source>1.9</maven.compiler.source>
<maven.compiler.target>1.9</maven.compiler.target>
<guava.version>25.1-jre</guava.version>
<unix4j.version>0.4</unix4j.version>
<grep4j.version>1.8.7</grep4j.version>
</properties>
</project>
</project>

View File

@ -10,12 +10,7 @@ This module contains articles about core Java Security
- [SHA-256 and SHA3-256 Hashing in Java](https://www.baeldung.com/sha-256-hashing-java)
- [Checksums in Java](https://www.baeldung.com/java-checksums)
- [How to Read PEM File to Get Public and Private Keys](https://www.baeldung.com/java-read-pem-file-keys)
- [Listing the Available Cipher Algorithms](https://www.baeldung.com/java-list-cipher-algorithms)
- [Get a List of Trusted Certificates in Java](https://www.baeldung.com/java-list-trusted-certificates)
- [Security Context Basics: User, Subject and Principal](https://www.baeldung.com/security-context-basics)
- [Java AES Encryption and Decryption](https://www.baeldung.com/java-aes-encryption-decryption)
- [InvalidAlgorithmParameterException: Wrong IV Length](https://www.baeldung.com/java-invalidalgorithmparameter-exception)
- [The java.security.egd JVM Option](https://www.baeldung.com/java-security-egd)
- [RSA in Java](https://www.baeldung.com/java-rsa)
- [3DES in Java](https://www.baeldung.com/java-3des)
- More articles: [[<-- prev]](/core-java-modules/core-java-security)

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -0,0 +1,11 @@
## Core Java Security Algorithms
This module contains articles about core Java Security Algorithms such as AES, DES, RSA, etc
### Relevant Articles:
- [Listing the Available Cipher Algorithms](https://www.baeldung.com/java-list-cipher-algorithms)
- [Java AES Encryption and Decryption](https://www.baeldung.com/java-aes-encryption-decryption)
- [InvalidAlgorithmParameterException: Wrong IV Length](https://www.baeldung.com/java-invalidalgorithmparameter-exception)
- [RSA in Java](https://www.baeldung.com/java-rsa)
- [3DES in Java](https://www.baeldung.com/java-3des)

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-security-algorithms</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>core-java-security-algorithms</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons-codec.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<!-- test scoped -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api.version}</version>
</dependency>
</dependencies>
<properties>
<!-- util -->
<bouncycastle.version>1.60</bouncycastle.version>
<commons-codec.version>1.11</commons-codec.version>
<!-- testing -->
<assertj-core.version>3.18.0</assertj-core.version>
<jaxb-api.version>2.3.1</jaxb-api.version>
</properties>
</project>

View File

@ -1,4 +1,4 @@
package com.baeldung.cipher;
package com.baeldung.rsa;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

View File

@ -4,8 +4,8 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-string-algorithms-3</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>core-java-string-algorithms-3</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
@ -61,4 +61,4 @@
<validator.version>1.7</validator.version>
</properties>
</project>
</project>

View File

@ -92,4 +92,4 @@
<semver4j.version>3.1.0</semver4j.version>
</properties>
</project>
</project>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -13,7 +13,6 @@
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -101,6 +101,7 @@
<module>core-java-security-2</module>
<module>core-java-security-3</module>
<module>core-java-serialization</module>
<module>core-java-security-algorithms</module>
<module>core-java-streams</module>
<module>core-java-streams-2</module>
<module>core-java-streams-3</module>

View File

@ -19,7 +19,6 @@
<artifactId>httpcore</artifactId>
<version>${http-component-version}</version>
</dependency>
<!-- ... -->
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<properties>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<properties>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<properties>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -12,7 +12,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<build>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<build>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>guava-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencies>

View File

@ -54,7 +54,8 @@
<artifactId>jbpm-test</artifactId>
<version>${jbpm.version}</version>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine
included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -157,4 +157,4 @@
<org.modelmapper.version>2.4.4</org.modelmapper.version>
</properties>
</project>
</project>

View File

@ -9,7 +9,6 @@
<groupId>com.baeldung</groupId>
<artifactId>logging-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>logging-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>

View File

@ -10,7 +10,6 @@
<groupId>com.baeldung</groupId>
<artifactId>logging-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>logging-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>

View File

@ -11,7 +11,6 @@
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modules>

View File

@ -18,7 +18,6 @@
<version>${archetype-packaging.version}</version>
</extension>
</extensions>
<!--.... -->
</build>
<properties>

View File

@ -54,7 +54,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>

View File

@ -57,7 +57,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>

View File

@ -54,7 +54,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>

View File

@ -51,7 +51,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>

View File

@ -1,62 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
<groupId>com.baeldung</groupId>
<artifactId>maven-generate-war</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>maven-generate-war</name>
<description>Spring boot project to demonstrate war file generation</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>maven-generate-war</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<webResources>
<resource>
<directory>additional_resources</directory>
</resource>
</webResources>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId>
<artifactId>maven-generate-war</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>maven-generate-war</name>
<description>Spring boot project to demonstrate war file generation</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>maven-generate-war</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<webResources>
<resource>
<directory>additional_resources</directory>
</resource>
</webResources>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<java.version>11</java.version>
</properties>
</project>

View File

@ -86,8 +86,8 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<excludes>
<exclude>DataTest.java</exclude>
@ -171,8 +171,8 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<excludes>
<exclude>DataTest.java</exclude>
@ -217,8 +217,8 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<executions>
<execution>
<phase>integration-test</phase>
@ -269,7 +269,6 @@
<properties>
<maven.resources.version>3.0.2</maven.resources.version>
<maven.compiler.version>3.8.0</maven.compiler.version>
<maven.surefire.version>2.22.0</maven.surefire.version>
<maven.failsafe.version>2.22.0</maven.failsafe.version>
<maven.verifier.version>1.1</maven.verifier.version>
<maven.clean.version>3.0.0</maven.clean.version>

View File

@ -54,8 +54,8 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<executions>
<execution>
<phase>integration-test</phase>
@ -81,7 +81,6 @@
<properties>
<maven.resources.version>3.0.2</maven.resources.version>
<maven.compiler.version>3.8.0</maven.compiler.version>
<maven.surefire.version>2.22.0</maven.surefire.version>
<maven.failsafe.version>2.22.0</maven.failsafe.version>
<maven.verifier.version>1.1</maven.verifier.version>
<maven.clean.version>3.0.0</maven.clean.version>

View File

@ -13,4 +13,4 @@
<!-- The parent pom is resolved to project a's pom.xml -->
</parent>
</project>
</project>

View File

@ -15,4 +15,4 @@
<relativePath>../../pom.xml</relativePath>
</parent>
</project>
</project>

View File

@ -18,4 +18,4 @@
<module>module3</module>
</modules>
</project>
</project>

View File

@ -19,4 +19,4 @@
<module>module2</module>
</modules>
</project>
</project>

View File

@ -84,8 +84,8 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<excludes>
<exclude>DataTest.java</exclude>
@ -105,8 +105,8 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<executions>
<execution>
<phase>integration-test</phase>
@ -132,7 +132,6 @@
<properties>
<maven.resources.version>3.0.2</maven.resources.version>
<maven.compiler.version>3.8.0</maven.compiler.version>
<maven.surefire.version>2.22.0</maven.surefire.version>
<maven.failsafe.version>2.22.0</maven.failsafe.version>
<maven.verifier.version>1.1</maven.verifier.version>
<maven.clean.version>3.0.0</maven.clean.version>

View File

@ -14,4 +14,4 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
</project>
</project>

View File

@ -37,7 +37,7 @@
<module>plugin-management</module>
<module>maven-surefire-plugin</module>
<module>maven-parent-pom-resolution</module>
<module>maven-dependency</module>
<module>maven-dependency</module>
</modules>
<dependencyManagement>
@ -57,8 +57,4 @@
</dependencies>
</dependencyManagement>
<properties>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -58,7 +58,6 @@
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

View File

@ -1,32 +0,0 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>1.0.0-SNAPSHOT</version>
<artifactId>simple-hexagonal-example</artifactId>
<name>simple-hexagonal-example</name>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-2</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,32 +0,0 @@
package com.baeldung.simplehexagonalex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.baeldung.simplehexagonalex.controller.QuoteCliController;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
@SpringBootApplication
public class DailyQuoteMain implements CommandLineRunner {
private static final Logger LOG = LoggerFactory.getLogger(DailyQuoteMain.class);
@Autowired
private QuoteCliController quoteCliController;
public static void main(final String[] args) {
SpringApplication.run(DailyQuoteMain.class, args);
}
@Override
public void run(String... args) throws Exception {
QuoteOfTheDay quoteOfTheDay = quoteCliController.getQuote("cliController");
LOG.info(quoteOfTheDay.toString());
}
}

View File

@ -1,24 +0,0 @@
package com.baeldung.simplehexagonalex.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
import com.baeldung.simplehexagonalex.domain.service.QuoteService;
@Component
public class QuoteCliController {
private static final Logger LOG = LoggerFactory.getLogger(QuoteCliController.class);
@Autowired
private QuoteService quoteService;
public QuoteOfTheDay getQuote(String userId) {
LOG.info("Getting quote");
return quoteService.getQuote(userId);
}
}

View File

@ -1,24 +0,0 @@
package com.baeldung.simplehexagonalex.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
import com.baeldung.simplehexagonalex.domain.service.QuoteService;
@RestController
@RequestMapping("/quote")
public class QuoteRestController {
@Autowired
private QuoteService quoteService;
@GetMapping(path = "/{userId}")
public QuoteOfTheDay getEmployee(@PathVariable("userId") String userId) {
return quoteService.getQuote(userId);
}
}

View File

@ -1,56 +0,0 @@
package com.baeldung.simplehexagonalex.domain;
import java.util.Objects;
public class QuoteOfTheDay {
private String userName;
private String quote;
private String provider;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getQuote() {
return quote;
}
public void setQuote(String quote) {
this.quote = quote;
}
public String getProvider() {
return provider;
}
public void setProvider(String provider) {
this.provider = provider;
}
@Override
public int hashCode() {
return Objects.hash(provider, quote, userName);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
QuoteOfTheDay other = (QuoteOfTheDay) obj;
return Objects.equals(provider, other.provider) && Objects.equals(quote, other.quote) && Objects.equals(userName, other.userName);
}
@Override
public String toString() {
return "QuoteOfTheDay [userName=" + userName + ", quote=" + quote + ", provider=" + provider + "]";
}
}

View File

@ -1,8 +0,0 @@
package com.baeldung.simplehexagonalex.domain.repository;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
public interface QuoteOfTheDayFromProvider {
QuoteOfTheDay getQuote();
}

View File

@ -1,22 +0,0 @@
package com.baeldung.simplehexagonalex.domain.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
import com.baeldung.simplehexagonalex.domain.repository.QuoteOfTheDayFromProvider;
@Service
public class QuoteAggregator implements QuoteService {
@Autowired
private QuoteOfTheDayFromProvider quoteOfTheDayFromProvider;
@Override
public QuoteOfTheDay getQuote(String userName) {
QuoteOfTheDay quoteOfTheDay = quoteOfTheDayFromProvider.getQuote();
quoteOfTheDay.setUserName(userName);
return quoteOfTheDay;
}
}

View File

@ -1,8 +0,0 @@
package com.baeldung.simplehexagonalex.domain.service;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
public interface QuoteService {
QuoteOfTheDay getQuote(String userName);
}

View File

@ -1,109 +0,0 @@
package com.baeldung.simplehexagonalex.repository.primary.quoteadapter;
import java.util.List;
import java.util.Objects;
public class ProviderQuote {
private String quote;
private String length;
private String author;
private List<String> tags;
private String category;
private String language;
private String date;
private String permalink;
private String id;
private String background;
private String title;
public ProviderQuote() {
}
public ProviderQuote(String quote, String length, String author, List<String> tags, String category, String language, String date, String permalink, String id, String background, String title) {
super();
this.quote = quote;
this.length = length;
this.author = author;
this.tags = tags;
this.category = category;
this.language = language;
this.date = date;
this.permalink = permalink;
this.id = id;
this.background = background;
this.title = title;
}
public String getQuote() {
return quote;
}
public String getLength() {
return length;
}
public String getAuthor() {
return author;
}
public List<String> getTags() {
return tags;
}
public String getCategory() {
return category;
}
public String getLanguage() {
return language;
}
public String getDate() {
return date;
}
public String getPermalink() {
return permalink;
}
public String getId() {
return id;
}
public String getBackground() {
return background;
}
public String getTitle() {
return title;
}
public void setId(String id) {
this.id = id;
}
@Override
public int hashCode() {
return Objects.hash(id);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ProviderQuote other = (ProviderQuote) obj;
return Objects.equals(id, other.id);
}
@Override
public String toString() {
return "TheysaysoQuote [quote=" + quote + ", length=" + length + ", " + "author=" + author + ", tags=" + tags + ", category=" + category + ", language=" + language + ", date=" + date + ", permalink=" + permalink + ", id=" + id + ", background="
+ background + ", title=" + title + "]";
}
}

View File

@ -1,54 +0,0 @@
package com.baeldung.simplehexagonalex.repository.primary.quoteadapter;
import java.net.URI;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
import com.baeldung.simplehexagonalex.domain.repository.QuoteOfTheDayFromProvider;
import com.fasterxml.jackson.databind.ObjectMapper;
@Service("providerQuoteAdapter")
@Primary
public class ProviderQuoteAdapter implements QuoteOfTheDayFromProvider {
@Autowired
private Environment env;
@Override
public QuoteOfTheDay getQuote() {
QuoteOfTheDay quoteOfTheDay = new QuoteOfTheDay();
ProviderQuoteEnvelope providerQuote;
try {
providerQuote = getProviderQuote();
quoteOfTheDay.setQuote(providerQuote.getContents()
.getQuotes()
.get(0)
.getQuote());
quoteOfTheDay.setProvider(providerQuote.getCopyright()
.getUrl());
} catch (Exception e) {
quoteOfTheDay.setQuote("Unable to get the quote");
quoteOfTheDay.setProvider("none");
}
return quoteOfTheDay;
}
private ProviderQuoteEnvelope getProviderQuote() throws Exception {
HttpGet request = new HttpGet(URI.create(env.getProperty("theysayso.quote.provider.url")));
CloseableHttpClient client = HttpClients.createDefault();
CloseableHttpResponse response = client.execute(request);
ProviderQuoteEnvelope providersQuote = new ObjectMapper().readValue(response.getEntity()
.getContent(), ProviderQuoteEnvelope.class);
return providersQuote;
}
}

View File

@ -1,68 +0,0 @@
package com.baeldung.simplehexagonalex.repository.primary.quoteadapter;
import java.util.List;
public class ProviderQuoteEnvelope {
private Success success;
private Contents contents;
private String baseurl;
private Copyright copyright;
public ProviderQuoteEnvelope() {
}
public ProviderQuoteEnvelope(Success success, Contents contents, String baseurl, Copyright copyright) {
super();
this.success = success;
this.contents = contents;
this.baseurl = baseurl;
this.copyright = copyright;
}
public Success getSuccess() {
return success;
}
public Contents getContents() {
return contents;
}
public String getBaseurl() {
return baseurl;
}
public Copyright getCopyright() {
return copyright;
}
public class Contents {
private List<ProviderQuote> quotes;
public List<ProviderQuote> getQuotes() {
return quotes;
}
}
public class Copyright {
private int year;
private String url;
public int getYear() {
return year;
}
public String getUrl() {
return url;
}
}
public class Success {
private int total;
public int getTotal() {
return total;
}
}
}

View File

@ -1,20 +0,0 @@
package com.baeldung.simplehexagonalex.reposity.mock.quoteadapter;
import org.springframework.stereotype.Service;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
import com.baeldung.simplehexagonalex.domain.repository.QuoteOfTheDayFromProvider;
@Service
public class MockQuoteAdapter implements QuoteOfTheDayFromProvider {
@Override
public QuoteOfTheDay getQuote() {
QuoteOfTheDay quoteOfTheDay = new QuoteOfTheDay();
quoteOfTheDay.setQuote("Mock quote of the day");
quoteOfTheDay.setProvider("Mock Provider");
return quoteOfTheDay;
}
}

View File

@ -1 +0,0 @@
theysayso.quote.provider.url=https://quotes.rest/qod?language=en

View File

@ -1,22 +0,0 @@
package com.baeldung.simplehexagonalex.repository.primaryQuoteProvider;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
import com.baeldung.simplehexagonalex.reposity.mock.quoteadapter.MockQuoteAdapter;
public class MockAccessProviderUnitTest {
@Test
public void givenProvider_whenConnect_thenResponse() throws Exception {
MockQuoteAdapter provider = new MockQuoteAdapter();
QuoteOfTheDay quote = provider.getQuote();
assertNotNull(quote);
assertEquals("Mock quote of the day", quote.getQuote());
assertEquals("Mock Provider", quote.getProvider());
}
}

View File

@ -1,28 +0,0 @@
package com.baeldung.simplehexagonalex.repository.primaryQuoteProvider;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import com.baeldung.simplehexagonalex.domain.QuoteOfTheDay;
import com.baeldung.simplehexagonalex.domain.repository.QuoteOfTheDayFromProvider;
@SpringBootTest
public class PrimaryAccessProviderIntegrationTest {
@Autowired
@Qualifier("providerQuoteAdapter")
QuoteOfTheDayFromProvider provider;
@Test
public void whenQuoteProvider_thenResponse() throws Exception {
QuoteOfTheDay quote = provider.getQuote();
assertNotNull(quote);
assertThat(quote.getProvider()).contains("theysaidso");
}
}

View File

@ -1,36 +0,0 @@
package com.baeldung.simplehexagonalex.repository.primaryQuoteProvider;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
@SpringBootTest
@AutoConfigureMockMvc
public class QuoteRequestIntegrationTest {
@Autowired
private MockMvc mockMvc;
@Test
public void whenRestQuoteRequest_thenResponse() throws Exception {
MvcResult result = this.mockMvc.perform(get("/quote/tester"))
.andDo(print())
.andExpect(status().isOk())
.andReturn();
String content = result.getResponse()
.getContentAsString();
assertThat(content).contains("tester");
assertThat(content).contains("theysaidso");
}
}

View File

@ -1 +0,0 @@
theysayso.quote.provider.url=https://quotes.rest/qod?language=en

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
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">
<modelVersion>4.0.0</modelVersion>
<artifactId>apache-derby</artifactId>
<parent>
<artifactId>persistence-modules</artifactId>
<groupId>com.baeldung</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apache-derby</artifactId>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.derby/derby -->
@ -18,15 +18,12 @@
<artifactId>derby</artifactId>
<version>10.13.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.derby/derbyclient -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.13.1.1</version>
</dependency>
</dependencies>
</project>

View File

@ -18,8 +18,8 @@
<dependencyManagement>
<dependencies>
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of junit:junit in the classpath. hence forcing the
latest 4.13.2 available version for junit5 compatibility -->
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of
junit:junit in the classpath. hence forcing the latest 4.13.2 available version for junit5 compatibility -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -1,72 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-2</relativePath>
</parent>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId>
<artifactId>spring-cassandra</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-cassandra</name>
<description>Demo project for Spring Data Cassandra</description>
<groupId>org.baeldung</groupId>
<artifactId>spring-cassandra</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-cassandra</name>
<description>Demo project for Spring Data Cassandra</description>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-2</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
<version>${org.springframework.data.version}</version>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-core</artifactId>
<version>${system.stubs.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>cassandra</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-jupiter</artifactId>
<version>${system.stubs.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
<version>${org.springframework.data.version}</version>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-core</artifactId>
<version>${system.stubs.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>cassandra</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-jupiter</artifactId>
<version>${system.stubs.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<java.version>11</java.version>
<org.springframework.data.version>3.1.11</org.springframework.data.version>
<testcontainers.version>1.15.3</testcontainers.version>
<system.stubs.version>1.1.0</system.stubs.version>
<junit.jupiter.version>5.6.2</junit.jupiter.version>
</properties>
<properties>
<java.version>11</java.version>
<org.springframework.data.version>3.1.11</org.springframework.data.version>
<testcontainers.version>1.15.3</testcontainers.version>
<system.stubs.version>1.1.0</system.stubs.version>
<junit.jupiter.version>5.6.2</junit.jupiter.version>
</properties>
</project>
</project>

View File

@ -49,7 +49,8 @@
<version>${cassandra-unit-shaded.version}</version>
<scope>test</scope>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine
included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
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">
<modelVersion>4.0.0</modelVersion>
<artifactId>quarkus-vs-springboot</artifactId>
<version>1.0-SNAPSHOT</version>
<name>quarkus-vs-springboot</name>
<packaging>pom</packaging>
<parent>
<artifactId>parent-modules</artifactId>
<groupId>com.baeldung</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<version>1.0-SNAPSHOT</version>
<name>quarkus-vs-springboot</name>
<artifactId>quarkus-vs-springboot</artifactId>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>quarkus-project</module>
<module>spring-project</module>

View File

@ -1,143 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>quarkus-vs-springboot</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>quarkus-project</artifactId>
<version>0.1-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>2.2.2.Final</quarkus.platform.version>
<surefire-plugin.version>3.0.0-M4</surefire-plugin.version>
</properties>
<dependencyManagement>
<modelVersion>4.0.0</modelVersion>
<artifactId>quarkus-project</artifactId>
<version>0.1-SNAPSHOT</version>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>quarkus-vs-springboot</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-reactive-panache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-pg-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-docker</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-reactive-panache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-pg-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-docker</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<parameters>${maven.compiler.parameters}</parameters>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemPropertyVariables>
<parameters>${maven.compiler.parameters}</parameters>
</configuration>
</execution>
</executions>
</plugin>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<quarkus.native.additional-build-args>-H:+AllowVMInspection</quarkus.native.additional-build-args>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<quarkus.native.additional-build-args>-H:+AllowVMInspection</quarkus.native.additional-build-args>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>2.2.2.Final</quarkus.platform.version>
<surefire-plugin.version>3.0.0-M4</surefire-plugin.version>
</properties>
</project>

View File

@ -1,25 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/>
</parent>
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">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-project</artifactId>
<groupId>com.baeldung</groupId>
<version>0.1-SNAPSHOT</version>
<properties>
<java.version>11</java.version>
<repackage.classifier/>
<spring-native.version>0.10.3</spring-native.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath />
</parent>
<dependencies>
<dependency>
@ -161,11 +154,19 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-DspringAot=true -agentlib:native-image-agent=access-filter-file=src/test/resources/access-filter.json,config-merge-dir=target/classes/META-INF/native-image</argLine>
<argLine>-DspringAot=true
-agentlib:native-image-agent=access-filter-file=src/test/resources/access-filter.json,config-merge-dir=target/classes/META-INF/native-image</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<java.version>11</java.version>
<repackage.classifier />
<spring-native.version>0.10.3</spring-native.version>
</properties>
</project>

View File

@ -16,8 +16,8 @@
<dependencyManagement>
<dependencies>
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of junit:junit in the classpath. hence forcing the
latest 4.13.2 available version for junit5 compatibility -->
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of
junit:junit in the classpath. hence forcing the latest 4.13.2 available version for junit5 compatibility -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

Some files were not shown because too many files have changed in this diff Show More