Skip to content

Commit

Permalink
Bug with VUU Server option for adding customised login validator is n…
Browse files Browse the repository at this point in the history
…ot setting
  • Loading branch information
wendymiaoo authored and keikeicheung committed Jun 20, 2024
1 parent 7c3c1f8 commit ee3ba63
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ trait VuuThreadingOptions{

case class VuuSecurityOptionsImpl(authenticator: Authenticator, loginTokenValidator: LoginTokenValidator) extends VuuSecurityOptions{
override def withAuthenticator(authenticator: Authenticator): VuuSecurityOptions = this.copy(authenticator = authenticator)
override def withLoginValidator(tokenValidator: LoginTokenValidator): VuuSecurityOptions = this.copy(authenticator = authenticator)
override def withLoginValidator(tokenValidator: LoginTokenValidator): VuuSecurityOptions = this.copy(loginTokenValidator = tokenValidator)
}

private case class VuuWebSocketOptionsImpl(wsPort: Int,
Expand Down
20 changes: 20 additions & 0 deletions vuu/src/test/scala/org/finos/vuu/core/VuuServerOptionsTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.finos.vuu.core

import org.finos.vuu.net.LoggedInTokenValidator
import org.scalatest.featurespec.AnyFeatureSpec
import org.scalatest.matchers.should.Matchers


class VuuServerOptionsTest extends AnyFeatureSpec with Matchers {

Feature("VUU Server option for adding customised login validator should be supported"){

Scenario("Create 1 security option with LoggedInTokenValidator other than the default Validator, check the type of login validator"){

val option = VuuSecurityOptions.apply()
.withLoginValidator(new LoggedInTokenValidator)

option.loginTokenValidator shouldBe a [LoggedInTokenValidator]
}
}
}

0 comments on commit ee3ba63

Please sign in to comment.