Skip to content

Commit

Permalink
Move to play 3 / pekko
Browse files Browse the repository at this point in the history
  • Loading branch information
larousso committed Oct 7, 2024
1 parent 3651af3 commit 6b6dd85
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions nio-server/test/controllers/OrganisationControllerSpec.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package controllers

import models._
import java.time.{LocalDateTime, Clock}
import utils.NioLogger

import java.time.{Clock, LocalDateTime}
import utils.{DateUtils, NioLogger, TestUtils}
import play.api.libs.json.{JsArray, JsValue, Json}
import play.api.libs.ws.WSResponse
import play.api.test.Helpers._
import utils.TestUtils

import java.time.format.DateTimeFormatter

class OrganisationControllerSpec extends TestUtils {

Expand Down Expand Up @@ -103,7 +105,7 @@ class OrganisationControllerSpec extends TestUtils {
(value \ "version" \ "latest").as[Boolean] mustBe org1.version.latest
(value \ "version" \ "neverReleased").asOpt[Boolean] mustBe None
(value \ "version" \ "lastUpdate").asOpt[String].map { s =>
val lastUpdate = LocalDateTime.parse(s)
val lastUpdate = LocalDateTime.parse(s, DateUtils.utcDateFormatter)
lastUpdate.isAfter(beforeNewOrgCreation) && lastUpdate.isBefore(LocalDateTime.now(Clock.systemUTC).plusSeconds(1))
} mustBe Some(true)

Expand Down Expand Up @@ -134,7 +136,7 @@ class OrganisationControllerSpec extends TestUtils {
(organisations \ 1 \ "version" \ "status").as[String] mustBe "DRAFT"
(organisations \ 1 \ "version" \ "num").as[Int] mustBe 1
(organisations \ 1 \ "version" \ "lastUpdate").asOpt[String].map { s =>
val lastUpdate = LocalDateTime.parse(s)
val lastUpdate = LocalDateTime.parse(s, DateUtils.utcDateFormatter)
lastUpdate.isAfter(beforeNewOrgCreation) && lastUpdate.isBefore(LocalDateTime.now(Clock.systemUTC).plusSeconds(1))
} mustBe Some(true)
}
Expand Down Expand Up @@ -186,7 +188,7 @@ class OrganisationControllerSpec extends TestUtils {
(value \ "version" \ "status").as[String] mustBe "RELEASED"
(value \ "version" \ "num").as[Int] mustBe org1.version.num
(value \ "version" \ "lastUpdate").asOpt[String].map { s =>
val lastUpdate = LocalDateTime.parse(s)
val lastUpdate = LocalDateTime.parse(s, DateUtils.utcDateFormatter)
lastUpdate.isBefore(LocalDateTime.now(Clock.systemUTC).plusSeconds(1))
} mustBe Some(true)
}
Expand Down

0 comments on commit 6b6dd85

Please sign in to comment.