当前位置: 首页>>代码示例>>Scala>>正文


Scala Generator类代码示例

本文整理汇总了Scala中uk.gov.hmrc.domain.Generator的典型用法代码示例。如果您正苦于以下问题:Scala Generator类的具体用法?Scala Generator怎么用?Scala Generator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Generator类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Scala代码示例。

示例1: PreconditionBuilder

//设置package包名称以及导入依赖的类
package uk.gov.hmrc.agentinvitations.support

import uk.gov.hmrc.agentinvitations.stubs._
import uk.gov.hmrc.agentmtdidentifiers.model.Arn
import uk.gov.hmrc.domain.{AgentCode, Generator, Nino}

trait StubUtils {
  me: StartAndStopWireMock =>

  class PreconditionBuilder {

    def agentAdmin(arn: String, agentCode: String): AgentAdmin = {
      AgentAdmin(arn, oid = "556737e15500005500eaf68e", agentCode)
    }

    def agentAdmin(arn: Arn, agentCode: AgentCode): AgentAdmin = {
      agentAdmin(arn.value, agentCode.value)
    }

    def user(oid: String = "1234567890abcdef00000000"): UnknownUser = {
      UnknownUser(oid)
    }

    def client(oid: String = "556737e15500005500eaf68f", clientId: Nino = new Generator().nextNino): Client = {
      Client(oid, clientId)
    }
  }

  def given() = {
    new PreconditionBuilder()
  }

  class BaseUser extends WiremockAware {
    override def wiremockBaseUrl: String = me.wiremockBaseUrl
  }

  case class AgentAdmin(
                         override val arn: String,
                         override val oid: String,
                         override val agentCode: String)
    extends BaseUser with AgentAuthStubs[AgentAdmin] {
  }

  case class UnknownUser(override val oid: String)
    extends BaseUser with UnknownUserAuthStubs[UnknownUser]

  case class Client(override val oid: String, override val clientId: Nino)
    extends BaseUser with ClientUserAuthStubs[Client] with RelationshipStubs[Client] with DesStubs[Client]
} 
开发者ID:hmrc,项目名称:agent-invitations,代码行数:50,代码来源:StubUtils.scala


注:本文中的uk.gov.hmrc.domain.Generator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。