dubeejw commented on a change in pull request #2593: Add BaseWsk class for Wsk 
and WskRest to inherit
URL: 
https://github.com/apache/incubator-openwhisk/pull/2593#discussion_r138430563
 
 

 ##########
 File path: tests/src/test/scala/common/Wsk.scala
 ##########
 @@ -101,43 +72,10 @@ class Wsk() extends RunWskCmd {
   implicit val api = new WskApi
 }
 
-trait FullyQualifiedNames {
-
-  /**
-   * Fully qualifies the name of an entity with its namespace.
-   * If the name already starts with the PATHSEP character, then
-   * it already is fully qualified. Otherwise (package name or
-   * basic entity name) it is prefixed with the namespace. The
-   * namespace is derived from the implicit whisk properties.
-   *
-   * @param name to fully qualify iff it is not already fully qualified
-   * @param wp whisk properties
-   * @return name if it is fully qualified else a name fully qualified for a 
namespace
-   */
-  def fqn(name: String)(implicit wp: WskProps) = {
-    val sep = "/" // Namespace.PATHSEP
-    if (name.startsWith(sep) || name.count(_ == sep(0)) == 2) name
-    else s"$sep${wp.namespace}$sep$name"
-  }
-
-  /**
-   * Resolves a namespace. If argument is defined, it takes precedence.
-   * else resolve to namespace in implicit WskProps.
-   *
-   * @param namespace an optional namespace
-   * @param wp whisk properties
-   * @return resolved namespace
-   */
-  def resolve(namespace: Option[String])(implicit wp: WskProps) = {
-    val sep = "/" // Namespace.PATHSEP
-    namespace getOrElse s"$sep${wp.namespace}"
-  }
-}
-
-trait ListOrGetFromCollection extends FullyQualifiedNames {
+trait ListOrGetFromCollectionCLI extends BaseListOrGetFromCollection {
   self: RunWskCmd =>
 
-  protected val noun: String
+  override protected val noun: String
 
 Review comment:
   Does this value have to be overridden if it is never set in this trait?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to