diff --git a/pom.xml b/pom.xml index 7dc65f454b75..9f8766d3d119 100644 --- a/pom.xml +++ b/pom.xml @@ -58,6 +58,7 @@ Java Design Patterns + publish-subscribe abstract-factory collecting-parameter monitor diff --git a/publish-subscribe/pom.xml b/publish-subscribe/pom.xml index 8b4d2806cd90..473c9362b661 100644 --- a/publish-subscribe/pom.xml +++ b/publish-subscribe/pom.xml @@ -35,7 +35,7 @@ java-design-patterns 1.26.0-SNAPSHOT - publishsubscribe + publish-subscribe @@ -43,27 +43,11 @@ junit-jupiter-api test - - org.mockito - mockito-core - test - org.apache.activemq activemq-core 5.7.0 - - org.apache.xbean - xbean-spring - 4.24 - - - org.apache.activemq.tooling - activemq-junit - 6.1.1 - test - \ No newline at end of file diff --git a/publish-subscribe/src/main/java/com/iluwatar/publishsubscribe/Borrower.java b/publish-subscribe/src/main/java/com/iluwatar/publishsubscribe/Borrower.java index a206a636af98..f94e4c31d102 100644 --- a/publish-subscribe/src/main/java/com/iluwatar/publishsubscribe/Borrower.java +++ b/publish-subscribe/src/main/java/com/iluwatar/publishsubscribe/Borrower.java @@ -1,7 +1,6 @@ package com.iluwatar.publishsubscribe; import lombok.extern.slf4j.Slf4j; -import org.slf4j.event.Level; import javax.jms.BytesMessage; import javax.jms.JMSException; import javax.jms.Message; @@ -25,7 +24,7 @@ public class Borrower implements MessageListener { private TopicConnection tConnection; private TopicSession tSession; private Topic topic; - private double currentRate; + private final double currentRate; private static final String ERROR = "An error has occured!"; private double newRate; diff --git a/publish-subscribe/src/test/java/com/iluwatar/publishsubscribe/BorrowerTest.java b/publish-subscribe/src/test/java/com/iluwatar/publishsubscribe/BorrowerTest.java index ded88e244087..cb33585a719f 100644 --- a/publish-subscribe/src/test/java/com/iluwatar/publishsubscribe/BorrowerTest.java +++ b/publish-subscribe/src/test/java/com/iluwatar/publishsubscribe/BorrowerTest.java @@ -1,25 +1,12 @@ package com.iluwatar.publishsubscribe; -import org.apache.activemq.Message; -import org.apache.activemq.broker.Broker; import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.command.ActiveMQTextMessage; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import javax.jms.BytesMessage; import javax.jms.JMSException; -import javax.jms.TextMessage; -import java.io.BufferedOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.sql.SQLOutput; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; public class BorrowerTest { diff --git a/publish-subscribe/src/test/java/com/iluwatar/publishsubscribe/LenderTest.java b/publish-subscribe/src/test/java/com/iluwatar/publishsubscribe/LenderTest.java index a103b0d9850f..e5420ee2603b 100644 --- a/publish-subscribe/src/test/java/com/iluwatar/publishsubscribe/LenderTest.java +++ b/publish-subscribe/src/test/java/com/iluwatar/publishsubscribe/LenderTest.java @@ -2,10 +2,8 @@ import org.apache.activemq.broker.BrokerService; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; public class LenderTest {