Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Zwiterrion committed Jan 10, 2025
1 parent 1eb1e19 commit 350c25c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
8 changes: 4 additions & 4 deletions otoroshi/test/Suites.scala
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class GreenScoreTest
new GreenScoreTestSpec("GreenScore", Configurations.InMemoryConfiguration)
)

class ApiKeysTest
extends Suites(
new ApiKeysSpec("ApiKeysSpec", Configurations.InMemoryConfiguration)
)
//class ApiKeysTest
// extends Suites(
// new ApiKeysSpec("ApiKeysSpec", Configurations.InMemoryConfiguration)
// )
22 changes: 3 additions & 19 deletions otoroshi/test/functional/ApiKeysSpec.scala
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package functional

import java.util.Base64
import java.util.concurrent.atomic.AtomicInteger

import akka.actor.ActorSystem
import com.auth0.jwt.JWT
import com.auth0.jwt.algorithms.Algorithm
import com.typesafe.config.ConfigFactory
import otoroshi.models.{ApiKey, ServiceDescriptor, ServiceGroupIdentifier, Target}
import org.scalatest.concurrent.IntegrationPatience
import org.scalatestplus.play.PlaySpec
import play.api.Configuration

import java.util.Base64
import java.util.concurrent.atomic.AtomicInteger

class ApiKeysSpec(name: String, configurationSpec: => Configuration) extends OtoroshiSpec {

lazy val serviceHost = "auth.oto.tools"
Expand Down Expand Up @@ -407,20 +405,6 @@ class ApiKeysSpec(name: String, configurationSpec: => Configuration) extends Oto
deleteOtoroshiService(service).futureValue
}

"prevent to many calls per window" in {
val testApiKey = new ApiKey(
clientId = "1234",
clientSecret = "1234567890",
clientName = "test apikey",
authorizedEntities = Seq(ServiceGroupIdentifier("default")),
enabled = true,
throttlingQuota = 10,
dailyQuota = 10,
monthlyQuota = 100,
metadata = Map.empty
)
}

"stop servers" in {
basicTestServer1.stop()
system.terminate()
Expand Down

0 comments on commit 350c25c

Please sign in to comment.