Skip to content

Commit

Permalink
FIX tests
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinovega committed Jan 26, 2021
1 parent 00f121e commit ce39b0a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions daikoku/test/daikoku/UserControllerSpec.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package fr.maif.otoroshi.daikoku.tests

import fr.maif.otoroshi.daikoku.logger.AppLogger
import fr.maif.otoroshi.daikoku.tests.utils.{
DaikokuSpecHelper,
OneServerPerSuiteWithMyComponents
Expand All @@ -22,7 +21,7 @@ class UserControllerSpec()
setupEnvBlocking(
tenants = Seq(tenant),
users = Seq(daikokuAdmin, user, userAdmin),
teams = Seq()
teams = Seq(defaultAdminTeam)
)
val session = loginWithBlocking(daikokuAdmin, tenant)

Expand All @@ -47,7 +46,6 @@ class UserControllerSpec()
val resp =
httpJsonCallBlocking(s"/api/admin/users/${user.id.value}")(tenant,
session)
AppLogger.info(Json.stringify(resp.json))
resp.status mustBe 200
val eventualUser =
fr.maif.otoroshi.daikoku.domain.json.UserFormat.reads(resp.json)
Expand Down Expand Up @@ -165,7 +163,6 @@ class UserControllerSpec()
val respRemove = httpJsonCallBlocking(
s"/api/admin/users/${user.id.value}")(tenant, session)
respRemove.status mustBe 200
logger.debug(Json.stringify(resp2.json))
val eventualUser2 =
fr.maif.otoroshi.daikoku.domain.json.UserFormat.reads(resp2.json)
eventualUser2.isSuccess mustBe true
Expand All @@ -181,12 +178,12 @@ class UserControllerSpec()
setupEnvBlocking(
tenants = Seq(tenant),
users = Seq(randomUser),
teams = Seq()
teams = Seq(defaultAdminTeam)
)
val session = loginWithBlocking(randomUser, tenant)

val resp = httpJsonCallBlocking("/api/admin/users")(tenant, session)
resp.status mustBe 401
resp.status mustBe 403
}

"not find user by id" in {
Expand Down

0 comments on commit ce39b0a

Please sign in to comment.