|
16 | 16 |
|
17 | 17 | package software.purpledragon.sbt.lock.model |
18 | 18 |
|
19 | | -import java.time.Instant |
20 | | - |
21 | 19 | import org.scalatest.flatspec.AnyFlatSpec |
22 | 20 | import org.scalatest.matchers.should.Matchers |
23 | 21 |
|
| 22 | +import java.time.Instant |
24 | 23 | import scala.collection.SortedSet |
25 | 24 |
|
26 | 25 | class DependencyLockFileSpec extends AnyFlatSpec with Matchers { |
27 | | - private val Dependency1Artifact = ResolvedArtifact("package-1.jar", "hash-1") |
28 | | - private val Dependency1 = |
29 | | - ResolvedDependency("com.example", "package-1", "1.0.0", SortedSet(Dependency1Artifact), SortedSet("test-1")) |
30 | | - private val Dependency2 = |
| 26 | + private val dependency1Artifact = ResolvedArtifact("package-1.jar", "hash-1") |
| 27 | + private val dependency1 = |
| 28 | + ResolvedDependency("com.example", "package-1", "1.0.0", SortedSet(dependency1Artifact), SortedSet("test-1")) |
| 29 | + private val dependency2 = |
31 | 30 | ResolvedDependency("com.example", "package-2", "1.2.0", SortedSet.empty, SortedSet("test-2")) |
32 | 31 |
|
33 | 32 | private val EmptyLockFile = DependencyLockFile(1, Instant.now(), Nil, Nil) |
34 | 33 | private val TestLockFile = DependencyLockFile( |
35 | 34 | 1, |
36 | 35 | Instant.now(), |
37 | 36 | Seq("test-1", "test-2"), |
38 | | - Seq(Dependency1, Dependency2) |
| 37 | + Seq(dependency1, dependency2) |
39 | 38 | ) |
40 | 39 |
|
41 | 40 | "findChanges" should "return LockFileMatches for identical lockfiles" in { |
@@ -159,12 +158,12 @@ class DependencyLockFileSpec extends AnyFlatSpec with Matchers { |
159 | 158 |
|
160 | 159 | val right = left.copy( |
161 | 160 | dependencies = Seq( |
162 | | - Dependency1.copy( |
| 161 | + dependency1.copy( |
163 | 162 | artifacts = SortedSet( |
164 | | - Dependency1Artifact, |
| 163 | + dependency1Artifact, |
165 | 164 | ResolvedArtifact("package-1a.jar", "hash-1a") |
166 | 165 | )), |
167 | | - Dependency2 |
| 166 | + dependency2 |
168 | 167 | )) |
169 | 168 |
|
170 | 169 | left.findChanges(right) shouldBe LockFileDiffers( |
@@ -192,8 +191,8 @@ class DependencyLockFileSpec extends AnyFlatSpec with Matchers { |
192 | 191 |
|
193 | 192 | val right = left.copy( |
194 | 193 | dependencies = Seq( |
195 | | - Dependency1.copy(artifacts = SortedSet.empty), |
196 | | - Dependency2 |
| 194 | + dependency1.copy(artifacts = SortedSet.empty), |
| 195 | + dependency2 |
197 | 196 | )) |
198 | 197 |
|
199 | 198 | left.findChanges(right) shouldBe LockFileDiffers( |
|
0 commit comments