Skip to content

Commit

Permalink
Merge pull request #121 from hmrc/SAR-1042
Browse files Browse the repository at this point in the history
Rename name for feature switch
  • Loading branch information
suyangyu authored Nov 2, 2017
2 parents e578f18 + 6ae9fa9 commit 065da46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/config/featureswitch/FeatureSwitch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import testonly.controllers.featureswitch.FeatureSwitchSetting

sealed trait FeatureSwitch {
val name: String
val shortName: String
val displayName: String
}

object FeatureSwitch {
Expand All @@ -36,13 +36,13 @@ object FeatureSwitch {
}

def apply(setting: FeatureSwitchSetting): FeatureSwitch =
switches find (_.shortName == setting.feature) match {
switches find (_.displayName == setting.feature) match {
case Some(switch) => switch
case None => throw new IllegalArgumentException("Invalid feature switch: " + setting.feature)
}
}

object StubDESFeature extends FeatureSwitch {
val shortName = s"stub-des"
val name = s"$prefix.$shortName"
val displayName = s"Use stub for DES connection"
val name = s"$prefix.stub-des"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ object FeatureSwitchSetting {
implicit val format: OFormat[FeatureSwitchSetting] = Json.format[FeatureSwitchSetting]

def apply(featureSwitch: FeatureSwitch, enable: Boolean): FeatureSwitchSetting =
FeatureSwitchSetting(featureSwitch.shortName, enable)
FeatureSwitchSetting(featureSwitch.displayName, enable)

}

0 comments on commit 065da46

Please sign in to comment.