You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2020/05/13 13:21:31 UTC

[incubator-nlpcraft-java-client] branch master updated: Code cleanup.

This is an automated email from the ASF dual-hosted git repository.

sergeykamov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft-java-client.git


The following commit(s) were added to refs/heads/master by this push:
     new 2c25131  Code cleanup.
2c25131 is described below

commit 2c25131b799c65a0afcc1cc69287c4c00f0762f4
Author: Sergey Kamov <se...@apache.org>
AuthorDate: Wed May 13 16:21:24 2020 +0300

    Code cleanup.
---
 src/test/java/org/apache/nlpcraft/client/NCFeedbackTest.java     | 3 +--
 src/test/java/org/apache/nlpcraft/client/NCMultiClientsTest.java | 1 -
 src/test/java/org/apache/nlpcraft/client/NCTestAdapter.java      | 5 ++---
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/nlpcraft/client/NCFeedbackTest.java b/src/test/java/org/apache/nlpcraft/client/NCFeedbackTest.java
index 9a114f3..572afe7 100644
--- a/src/test/java/org/apache/nlpcraft/client/NCFeedbackTest.java
+++ b/src/test/java/org/apache/nlpcraft/client/NCFeedbackTest.java
@@ -45,8 +45,7 @@ class NCFeedbackTest extends NCTestAdapter {
      */
     private void test0(Long usrId, String usrExtId) throws Exception {
         // Adds request.
-        String srvReqId = admCli.ask(MDL_ID, "Ping me in 3 minutes", null, false, usrId, usrExtId
-        );
+        String srvReqId = admCli.ask(MDL_ID, "Ping me in 3 minutes", null, false, usrId, usrExtId);
     
         // Creates 2 feedback.
         long fId1 = admCli.addFeedback(srvReqId, 0.5, null, usrId, usrExtId);
diff --git a/src/test/java/org/apache/nlpcraft/client/NCMultiClientsTest.java b/src/test/java/org/apache/nlpcraft/client/NCMultiClientsTest.java
index 231d521..099e182 100644
--- a/src/test/java/org/apache/nlpcraft/client/NCMultiClientsTest.java
+++ b/src/test/java/org/apache/nlpcraft/client/NCMultiClientsTest.java
@@ -31,7 +31,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static java.util.concurrent.TimeUnit.MINUTES;
 
 /**
  * REST client test. Methods `ask`.
diff --git a/src/test/java/org/apache/nlpcraft/client/NCTestAdapter.java b/src/test/java/org/apache/nlpcraft/client/NCTestAdapter.java
index 15e33f9..d8a329d 100644
--- a/src/test/java/org/apache/nlpcraft/client/NCTestAdapter.java
+++ b/src/test/java/org/apache/nlpcraft/client/NCTestAdapter.java
@@ -54,7 +54,7 @@ abstract class NCTestAdapter {
     protected long admUsrId;
 
     /** */
-    private Optional<Class<? extends NCModel>> mdlOpt = getModelClass();
+    private final Optional<Class<? extends NCModel>> mdlOpt = getModelClass();
 
     /**
      *
@@ -70,8 +70,7 @@ abstract class NCTestAdapter {
      */
     @BeforeEach
     void setUp() throws Exception {
-        if (mdlOpt.isPresent())
-            NCEmbeddedProbe.start(mdlOpt.get());
+        mdlOpt.ifPresent(NCEmbeddedProbe::start);
 
         admCli = new NCClientBuilder().build();