chetanmeh commented on a change in pull request #3890: Use ArtifactStore to
manipulate data in NamespaceBlacklistTests
URL:
https://github.com/apache/incubator-openwhisk/pull/3890#discussion_r206079037
##########
File path:
tests/src/test/scala/whisk/core/invoker/test/NamespaceBlacklistTests.scala
##########
@@ -92,49 +63,34 @@ class NamespaceBlacklistTests
val ak5 = BasicAuthenticationAuthKey(uuid5, Secret())
val ns4 = Namespace(EntityName("different1"), uuid4)
val ns5 = Namespace(EntityName("different2"), uuid5)
- val subject = WhiskAuth(Subject(), Set(WhiskNamespace(ns4, ak4),
WhiskNamespace(ns5, ak5)))
- val blockedSubject = JsObject(subject.toJson.fields + ("blocked" ->
true.toJson))
+ val blockedSubject = new ExtendedAuth(Subject(), Set(WhiskNamespace(ns4,
ak4), WhiskNamespace(ns5, ak5)), true)
- val blockedNamespacesCount = 2 + subject.namespaces.size
+ val blockedNamespacesCount = 2 + blockedSubject.namespaces.size
- def authToIdentities(auth: WhiskAuth): Set[Identity] = {
+ private def authToIdentities(auth: WhiskAuth): Set[Identity] = {
auth.namespaces.map { ns =>
Identity(auth.subject, ns.namespace, ns.authkey, Set(), UserLimits())
}
}
- override protected def withFixture(test: NoArgTest) = {
- assume(isCouchStore(authStore))
- super.withFixture(test)
+ private def limitToIdentity(limit: LimitEntity): Identity = {
+ val namespace = limit.docid.id.dropRight(7)
Review comment:
Instead of constant use `"/limits".length`. Helps to understand the
intention better
----------------------------------------------------------------
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