Rewrite JsHelper and other minor fixes

Makes field path extraction explicit.
Deprecated JsHelpers trait to allow Catalog to transition.
Reduce test verbosity.
log activation ids when matching more (or less) than N ids.
Fix bad log message where there are no creds.
diff --git a/tests/src/common/JsHelpers.scala b/tests/src/common/JsHelpers.scala
index 414b490..55476d5 100644
--- a/tests/src/common/JsHelpers.scala
+++ b/tests/src/common/JsHelpers.scala
@@ -14,31 +14,25 @@
  * limitations under the License.
  */
 
+// This is a copy of the JsHelpers as a trait to allow
+// catalog tests to still work until they are migrated
 package common
 
-import scala.language.postfixOps
-import scala.util.Try
-
 import spray.json.JsObject
 import spray.json.JsValue
 
+/**
+ * @deprecated Use {@link whisk.common.JsHelpers} instead.
+ */
+@Deprecated
 trait JsHelpers {
     implicit class JsObjectHelper(js: JsObject) {
         def getFieldPath(path: String*): Option[JsValue] = {
-            if (path.size == 1) {
-                Try {
-                    js.fields(path(0))
-                } toOption
-            } else if (js.getFields(path(0)).size > 0) {
-                // current segment exists, but there are more...
-                js.fields(path(0)).asJsObject.getFieldPath(path.tail: _*)
-            } else {
-                None
-            }
+            whisk.utils.JsHelpers.getFieldPath(js, path.toList)
         }
 
         def fieldPathExists(path: String*): Boolean = {
-            !js.getFieldPath(path: _*).isEmpty
+            whisk.utils.JsHelpers.fieldPathExists(js, path.toList)
         }
     }
 }
diff --git a/tests/src/common/WskTestHelpers.scala b/tests/src/common/WskTestHelpers.scala
index bca6b12..9bfabe2 100644
--- a/tests/src/common/WskTestHelpers.scala
+++ b/tests/src/common/WskTestHelpers.scala
@@ -206,7 +206,7 @@
                 implicit wskprops: WskProps): Unit = {
 
         val activationIds = wsk.pollFor(N, Some(entity), since = since, retries = (totalWait / pollPeriod).toInt, pollPeriod = pollPeriod)
-        withClue(s"did not find $N activations for $entity since $since") {
+        withClue(s"expecting $N activations matching '$entity' name since $since but found ${activationIds.mkString(",")} instead") {
             activationIds.length shouldBe N
         }
 
diff --git a/tests/src/services/KafkaConnectorTests.scala b/tests/src/services/KafkaConnectorTests.scala
index 95dba00..769acc2 100644
--- a/tests/src/services/KafkaConnectorTests.scala
+++ b/tests/src/services/KafkaConnectorTests.scala
@@ -29,7 +29,7 @@
 import org.scalatest.Matchers
 import org.scalatest.junit.JUnitRunner
 
-import akka.event.Logging.DebugLevel
+import akka.event.Logging.ErrorLevel
 import whisk.common.TransactionId
 import whisk.connector.kafka.KafkaConsumerConnector
 import whisk.connector.kafka.KafkaProducerConnector
@@ -58,8 +58,8 @@
     val producer = new KafkaProducerConnector(config.kafkaHost, ec)
     val consumer = new TestKafkaConsumerConnector(config.kafkaHost, groupid, topic, sessionTimeout = sessionTimeout)
 
-    producer.setVerbosity(DebugLevel)
-    consumer.setVerbosity(DebugLevel)
+    producer.setVerbosity(ErrorLevel)
+    consumer.setVerbosity(ErrorLevel)
 
     override def afterAll() {
         producer.close()
diff --git a/tests/src/system/basic/CLIPythonTests.scala b/tests/src/system/basic/CLIPythonTests.scala
index b0417d6..9369e65 100644
--- a/tests/src/system/basic/CLIPythonTests.scala
+++ b/tests/src/system/basic/CLIPythonTests.scala
@@ -27,14 +27,12 @@
 import common.TestHelpers
 import common.WskTestHelpers
 import common.WskProps
-import common.JsHelpers
 import common.WhiskProperties
 
 @RunWith(classOf[JUnitRunner])
 class CLIPythonTests
     extends TestHelpers
     with WskTestHelpers
-    with JsHelpers
     with Matchers {
 
     implicit val wskprops = WskProps()
diff --git a/tests/src/system/basic/Swift3WhiskObjectTests.scala b/tests/src/system/basic/Swift3WhiskObjectTests.scala
index 41a86d3..c04c516 100644
--- a/tests/src/system/basic/Swift3WhiskObjectTests.scala
+++ b/tests/src/system/basic/Swift3WhiskObjectTests.scala
@@ -29,13 +29,11 @@
 import common.WskTestHelpers
 import spray.json.DefaultJsonProtocol.StringJsonFormat
 import spray.json.pimpAny
-import common.JsHelpers
 
 @RunWith(classOf[JUnitRunner])
 class Swift3WhiskObjectTests
     extends TestHelpers
-    with WskTestHelpers
-    with JsHelpers {
+    with WskTestHelpers {
 
     implicit val wskprops = WskProps()
     val wsk = new Wsk
diff --git a/tests/src/system/basic/WskBasicNodeTests.scala b/tests/src/system/basic/WskBasicNodeTests.scala
index 29b4811..9225584 100644
--- a/tests/src/system/basic/WskBasicNodeTests.scala
+++ b/tests/src/system/basic/WskBasicNodeTests.scala
@@ -16,23 +16,21 @@
 
 package system.basic
 
-import org.junit.runner.RunWith
 import scala.concurrent.duration.DurationInt
+
+import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
 
 import common.JsHelpers
 import common.TestHelpers
 import common.TestUtils
 import common.TestUtils.ANY_ERROR_EXIT
+import common.TestUtils.RunResult
 import common.Wsk
 import common.WskProps
 import common.WskTestHelpers
-import spray.json.DefaultJsonProtocol.StringJsonFormat
-import spray.json.pimpAny
-import spray.json.pimpString
-import spray.json.JsString
-import common.TestUtils.RunResult
-import spray.json.JsObject
+import spray.json._
+import spray.json.DefaultJsonProtocol._
 
 @RunWith(classOf[JUnitRunner])
 class WskBasicNodeTests
diff --git a/tests/src/system/basic/WskRuleTests.scala b/tests/src/system/basic/WskRuleTests.scala
index 6ab6604..7c7c0bb 100644
--- a/tests/src/system/basic/WskRuleTests.scala
+++ b/tests/src/system/basic/WskRuleTests.scala
@@ -19,7 +19,6 @@
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
 
-import common.JsHelpers
 import common.TestHelpers
 import common.TestUtils
 import common.Wsk
@@ -32,7 +31,6 @@
 @RunWith(classOf[JUnitRunner])
 class WskRuleTests
     extends TestHelpers
-    with JsHelpers
     with WskTestHelpers {
 
     implicit val wskprops = WskProps()
diff --git a/tests/src/system/basic/WskSequenceTests.scala b/tests/src/system/basic/WskSequenceTests.scala
index f9721df..d993a54 100644
--- a/tests/src/system/basic/WskSequenceTests.scala
+++ b/tests/src/system/basic/WskSequenceTests.scala
@@ -25,7 +25,6 @@
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
 
-import common.JsHelpers
 import common.TestHelpers
 import common.TestUtils
 import common.TestUtils._
@@ -47,7 +46,6 @@
 @RunWith(classOf[JUnitRunner])
 class WskSequenceTests
     extends TestHelpers
-    with JsHelpers
     with ScalatestRouteTest
     with WskTestHelpers {
 
diff --git a/tests/src/whisk/core/cli/test/SequenceMigrationTests.scala b/tests/src/whisk/core/cli/test/SequenceMigrationTests.scala
index ad6aaa3..c28f876 100644
--- a/tests/src/whisk/core/cli/test/SequenceMigrationTests.scala
+++ b/tests/src/whisk/core/cli/test/SequenceMigrationTests.scala
@@ -19,7 +19,6 @@
 import scala.concurrent.duration.DurationInt
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
-import common.JsHelpers
 import common.TestHelpers
 import common.TestUtils
 import common.Wsk
@@ -45,7 +44,6 @@
     extends TestHelpers
     with BeforeAndAfter
     with DbUtils
-    with JsHelpers
     with ScalatestRouteTest
     with WskTestHelpers {
 
diff --git a/tests/src/whisk/core/cli/test/WskActionSequenceTests.scala b/tests/src/whisk/core/cli/test/WskActionSequenceTests.scala
index 56be417..99297f9 100644
--- a/tests/src/whisk/core/cli/test/WskActionSequenceTests.scala
+++ b/tests/src/whisk/core/cli/test/WskActionSequenceTests.scala
@@ -19,7 +19,6 @@
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
 
-import common.JsHelpers
 import common.TestHelpers
 import common.TestUtils
 import common.Wsk
@@ -34,7 +33,6 @@
 @RunWith(classOf[JUnitRunner])
 class WskActionSequenceTests
     extends TestHelpers
-    with JsHelpers
     with WskTestHelpers {
 
     implicit val wskprops = WskProps()
diff --git a/tests/src/whisk/core/container/test/ContainerPoolTests.scala b/tests/src/whisk/core/container/test/ContainerPoolTests.scala
index 81be9c0..afb5474 100644
--- a/tests/src/whisk/core/container/test/ContainerPoolTests.scala
+++ b/tests/src/whisk/core/container/test/ContainerPoolTests.scala
@@ -25,7 +25,7 @@
 import org.scalatest.FlatSpec
 import org.scalatest.junit.JUnitRunner
 
-import akka.event.Logging.InfoLevel
+import akka.event.Logging.ErrorLevel
 import whisk.common.TransactionId
 import whisk.core.WhiskConfig
 import whisk.core.WhiskConfig.dockerEndpoint
@@ -70,7 +70,7 @@
 
     assert(config.isValid)
 
-    val pool = new ContainerPool(config, 0, InfoLevel, true, true)
+    val pool = new ContainerPool(config, 0, ErrorLevel, true, true)
     pool.logDir = "/tmp"
 
     val datastore = WhiskEntityStore.datastore(config)
diff --git a/tests/src/whisk/core/controller/test/ActionsApiTests.scala b/tests/src/whisk/core/controller/test/ActionsApiTests.scala
index 03da7a7..49820a7 100644
--- a/tests/src/whisk/core/controller/test/ActionsApiTests.scala
+++ b/tests/src/whisk/core/controller/test/ActionsApiTests.scala
@@ -416,7 +416,9 @@
         val stream = new ByteArrayOutputStream
         val printstream = new PrintStream(stream)
         val savedstream = authStore.outputStream
+        val savedVerbosity = entityStore.getVerbosity()
         entityStore.outputStream = printstream
+        entityStore.setVerbosity(akka.event.Logging.InfoLevel)
         try {
             // first request invalidates any previous entries and caches new result
             Put(s"$collectionPath/$name", content) ~> sealRoute(routes(creds)(transid())) ~> check {
@@ -453,6 +455,7 @@
             stream.reset()
         } finally {
             entityStore.outputStream = savedstream
+            entityStore.setVerbosity(savedVerbosity)
             stream.close()
             printstream.close()
         }
diff --git a/tests/src/whisk/core/controller/test/AuthenticateTests.scala b/tests/src/whisk/core/controller/test/AuthenticateTests.scala
index b73fa41..7f8aadb 100644
--- a/tests/src/whisk/core/controller/test/AuthenticateTests.scala
+++ b/tests/src/whisk/core/controller/test/AuthenticateTests.scala
@@ -66,7 +66,9 @@
         val stream = new ByteArrayOutputStream
         val printstream = new PrintStream(stream)
         val savedstream = authStore.outputStream
+        val savedVerbosity = authStore.getVerbosity()
         authStore.outputStream = printstream
+        authStore.setVerbosity(akka.event.Logging.InfoLevel)
         try {
             val user = Await.result(validateCredentials(Some(pass))(transid()), dbOpTimeout)
             user.get should be(creds)
@@ -80,6 +82,7 @@
             stream.reset()
         } finally {
             authStore.outputStream = savedstream
+            authStore.setVerbosity(savedVerbosity)
             stream.close()
             printstream.close()
         }
diff --git a/tests/src/whisk/core/controller/test/ControllerTestCommon.scala b/tests/src/whisk/core/controller/test/ControllerTestCommon.scala
index a55ce3b..ad8160d 100644
--- a/tests/src/whisk/core/controller/test/ControllerTestCommon.scala
+++ b/tests/src/whisk/core/controller/test/ControllerTestCommon.scala
@@ -25,7 +25,7 @@
 import org.scalatest.FlatSpec
 import org.scalatest.Matchers
 
-import akka.event.Logging.{ InfoLevel, LogLevel }
+import akka.event.Logging.{ ErrorLevel, InfoLevel, LogLevel }
 import spray.http.BasicHttpCredentials
 import spray.json.DefaultJsonProtocol
 import spray.json.JsString
@@ -143,12 +143,12 @@
         }
     }
 
-    setVerbosity(InfoLevel)
-    Collection.initialize(entityStore, InfoLevel)
-    entityStore.setVerbosity(InfoLevel)
-    activationStore.setVerbosity(InfoLevel)
-    authStore.setVerbosity(InfoLevel)
-    entitlementProvider.setVerbosity(InfoLevel)
+    setVerbosity(ErrorLevel)
+    Collection.initialize(entityStore, ErrorLevel)
+    entityStore.setVerbosity(ErrorLevel)
+    activationStore.setVerbosity(ErrorLevel)
+    authStore.setVerbosity(ErrorLevel)
+    entitlementProvider.setVerbosity(ErrorLevel)
 
     val ACTIONS = Collection(Collection.ACTIONS)
     val TRIGGERS = Collection(Collection.TRIGGERS)
@@ -162,7 +162,7 @@
     }
 
     override def afterAll() {
-        println("Shutting down cloudant connections");
+        println("Shutting down db connections");
         entityStore.shutdown()
         activationStore.shutdown()
         authStore.shutdown()
diff --git a/tests/src/whisk/core/entity/test/SchemaTests.scala b/tests/src/whisk/core/entity/test/SchemaTests.scala
index 0db33c6..d659e42 100644
--- a/tests/src/whisk/core/entity/test/SchemaTests.scala
+++ b/tests/src/whisk/core/entity/test/SchemaTests.scala
@@ -36,6 +36,7 @@
 import whisk.core.entitlement.Privilege
 import whisk.core.entity._
 import whisk.core.entity.size.SizeInt
+import whisk.utils.JsHelpers
 
 @RunWith(classOf[JUnitRunner])
 class SchemaTests extends FlatSpec with BeforeAndAfter with Matchers {
@@ -554,4 +555,26 @@
         assert(ActivationId.unapply(id).isEmpty)
         assert(Try { ActivationId.serdes.read(JsString(id)) }.failed.get.getMessage.contains("too short"))
     }
+
+    behavior of "Js Helpers"
+
+    it should "project paths from json object" in {
+        val js = JsObject("a" -> JsObject("b" -> JsObject("c" -> JsString("v"))), "b" -> JsString("v"))
+        JsHelpers.fieldPathExists(js) shouldBe true
+        JsHelpers.fieldPathExists(js, "a") shouldBe true
+        JsHelpers.fieldPathExists(js, "a", "b") shouldBe true
+        JsHelpers.fieldPathExists(js, "a", "b", "c") shouldBe true
+        JsHelpers.fieldPathExists(js, "a", "b", "c", "d") shouldBe false
+        JsHelpers.fieldPathExists(js, "b") shouldBe true
+        JsHelpers.fieldPathExists(js, "c") shouldBe false
+
+        JsHelpers.getFieldPath(js) shouldBe Some(js)
+        JsHelpers.getFieldPath(js, "x") shouldBe None
+        JsHelpers.getFieldPath(js, "b") shouldBe Some(JsString("v"))
+        JsHelpers.getFieldPath(js, "a") shouldBe Some(JsObject("b" -> JsObject("c" -> JsString("v"))))
+        JsHelpers.getFieldPath(js, "a", "b") shouldBe Some(JsObject("c" -> JsString("v")))
+        JsHelpers.getFieldPath(js, "a", "b", "c") shouldBe Some(JsString("v"))
+        JsHelpers.getFieldPath(js, "a", "b", "c", "d") shouldBe None
+        JsHelpers.getFieldPath(JsObject()) shouldBe Some(JsObject())
+    }
 }