@@ -28,7 +28,7 @@ import spray.json.DefaultJsonProtocol._
2828import spray .json ._
2929import org .apache .openwhisk .common .TransactionId
3030import org .apache .openwhisk .core .database .SubjectHandler .SubjectView
31- import org .apache .openwhisk .core .database .WhisksHandler .ROOT_NS
31+ import org .apache .openwhisk .core .database .WhisksHandler .{ FULL_NAME , ROOT_NS }
3232import org .apache .openwhisk .core .database ._
3333import org .apache .openwhisk .core .entity ._
3434
@@ -48,14 +48,18 @@ class DocumentHandlerTests extends FlatSpec with Matchers with ScalaFutures with
4848
4949 it should " return JsObject when namespace is simple name" in {
5050 WhisksHandler .computedFields(JsObject ((" namespace" , JsString (" foo" )))) shouldBe JsObject ((ROOT_NS , JsString (" foo" )))
51- WhisksHandler .computedFields(newRule(" foo" ).toDocumentRecord) shouldBe JsObject ((ROOT_NS , JsString (" foo" )))
51+ WhisksHandler .computedFields(newRule(" foo" ).toDocumentRecord) shouldBe JsObject (
52+ (ROOT_NS , JsString (" foo" )),
53+ (FULL_NAME , JsString (" foo/foo" )))
5254 }
5355
5456 it should " return JsObject when namespace is path" in {
5557 WhisksHandler .computedFields(JsObject ((" namespace" , JsString (" foo/bar" )))) shouldBe
5658 JsObject ((ROOT_NS , JsString (" foo" )))
5759
58- WhisksHandler .computedFields(newRule(" foo/bar" ).toDocumentRecord) shouldBe JsObject ((ROOT_NS , JsString (" foo" )))
60+ WhisksHandler .computedFields(newRule(" foo/bar" ).toDocumentRecord) shouldBe JsObject (
61+ (ROOT_NS , JsString (" foo" )),
62+ (FULL_NAME , JsString (" foo/bar/foo" )))
5963 }
6064
6165 private def newRule (ns : String ): WhiskRule = {
0 commit comments