Skip to content

Commit 4f4637e

Browse files
committed
Add deserialisation test for VersionsCache Value
1 parent 9e7f7b3 commit 4f4637e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"updatedAt": 1000,
3+
"versions": ["1.0.0", "1.0.1"],
4+
"maybeError": null
5+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.scalasteward.core.coursier
2+
3+
import io.circe.parser
4+
import munit.FunSuite
5+
import org.scalasteward.core.coursier.VersionsCache.Value
6+
import org.scalasteward.core.data.Version
7+
import org.scalasteward.core.util.Timestamp
8+
9+
import scala.io.Source
10+
11+
class VersionsCacheTest extends FunSuite {
12+
test("version cache deserialisation without first seen") {
13+
val input = Source.fromResource("versions-cache-value-without-first-seen.json").mkString
14+
val expected = Value(Timestamp(1000), List(Version("1.0.0"), Version("1.0.1")), None)
15+
assertEquals(parser.decode[Value](input), Right(expected))
16+
}
17+
}

0 commit comments

Comments
 (0)