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 2021/06/24 12:37:18 UTC

[incubator-nlpcraft] branch NLPCRAFT-345 updated: WIP.

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

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


The following commit(s) were added to refs/heads/NLPCRAFT-345 by this push:
     new 2e3026a  WIP.
2e3026a is described below

commit 2e3026ae5aa4e14c1ef8e705ee67a744eed3eb28
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Thu Jun 24 15:37:06 2021 +0300

    WIP.
---
 .../apache/nlpcraft/examples/weather/NCModelValidationSpec.scala | 9 ++++-----
 .../weather/src/test/resources/openweathermap/api_key.txt        | 1 -
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/nlpcraft-examples/weather/src/test/java/org/apache/nlpcraft/examples/weather/NCModelValidationSpec.scala b/nlpcraft-examples/weather/src/test/java/org/apache/nlpcraft/examples/weather/NCModelValidationSpec.scala
index 465120f..136d713 100644
--- a/nlpcraft-examples/weather/src/test/java/org/apache/nlpcraft/examples/weather/NCModelValidationSpec.scala
+++ b/nlpcraft-examples/weather/src/test/java/org/apache/nlpcraft/examples/weather/NCModelValidationSpec.scala
@@ -17,7 +17,6 @@
 
 package org.apache.nlpcraft.examples.weather
 
-import org.apache.nlpcraft.common.U
 import org.apache.nlpcraft.model.tools.test.NCTestAutoModelValidator
 import org.junit.jupiter.api.{Assertions, Test}
 
@@ -25,19 +24,19 @@ import org.junit.jupiter.api.{Assertions, Test}
   * JUnit model validation.
   */
 class NCModelValidationSpec {
-    private final val PROP_NAME = "OWM_API_KEY"
+    private final val propName = "OWM_API_KEY"
 
     @Test
     def test(): Unit = {
         // Set your own API key here.
-        var apiKey: String = System.getProperty(PROP_NAME)
+        var apiKey: String = System.getProperty(propName)
 
         if (apiKey == null)
-            apiKey = System.getenv(PROP_NAME)
+            apiKey = System.getenv(propName)
 
         // Default value, used for tests.
         if (apiKey == null)
-            System.setProperty(PROP_NAME, U.readResource("openweathermap/api_key.txt").mkString.strip)
+            System.setProperty(propName, "8a51a2eb343bf87dc55ffd352f5641ea")
 
         // Instruct auto-validator what models to test.
         System.setProperty("NLPCRAFT_TEST_MODELS", "org.apache.nlpcraft.examples.weather.WeatherModel")
diff --git a/nlpcraft-examples/weather/src/test/resources/openweathermap/api_key.txt b/nlpcraft-examples/weather/src/test/resources/openweathermap/api_key.txt
deleted file mode 100644
index 0a4af6e..0000000
--- a/nlpcraft-examples/weather/src/test/resources/openweathermap/api_key.txt
+++ /dev/null
@@ -1 +0,0 @@
-20cb4ca5715a699436af8fab11d234e6
\ No newline at end of file