Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -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>

<groupId>org.example</groupId>
Expand All @@ -14,7 +14,8 @@
<maven.compiler.target>11</maven.compiler.target>
<lombok.version>1.18.12</lombok.version>
<junit-jupiter-api.version>5.7.0-M1</junit-jupiter-api.version>
<slf4j-api.version>1.7.30</slf4j-api.version>
<slf4j-api.version>1.7.32</slf4j-api.version>
<log4j.version>2.14.1</log4j.version>
</properties>

<dependencies>
Expand All @@ -29,16 +30,29 @@
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>

<!-- Logging-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-api.version}</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>

<!-- Test dependencies-->
<dependency>
<groupId>io.projectreactor</groupId>
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
appenders=console

appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{yy-MMM-dd HH:mm:ss:SSS}] [%p] [%c{1}:%L] - %m%n

rootLogger.level = debug
rootLogger.appenderRefs = stdout
rootLogger.appenderRef.abc.ref = STDOUT
4 changes: 2 additions & 2 deletions src/test/java/academy/devdojo/reactive/test/MonoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ public void monoSubscriberConsumerSubscription() {
@Test
public void monoDoOnMethods() {
String name = "William Suane";
Mono<Object> mono = Mono.just(name)
Mono<String> mono = Mono.just(name)
.log()
.map(String::toUpperCase)
.doOnSubscribe(subscription -> log.info("Subscribed"))
.doOnRequest(longNumber -> log.info("Request Received, starting doing something..."))
.doOnNext(s -> log.info("Value is here. Executing doOnNext {}",s))
.flatMap(s -> Mono.empty())
.flatMap(s -> Mono.<String>empty())
.doOnNext(s -> log.info("Value is here. Executing doOnNext {}",s)) //will not be executed
.doOnSuccess(s -> log.info("doOnSuccess executed {}", s));

Expand Down