Skip to content

Commit

Permalink
Merge pull request #274 from hofi1/fix-flaky-tests
Browse files Browse the repository at this point in the history
Fix flaky tests
  • Loading branch information
jk1 committed Nov 1, 2023
2 parents 5e273f9 + 9b5ca80 commit 232fc7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/main/groovy/com/github/jk1/license/Model.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class ConfigurationData {
class ModuleData {
String group, name, version
Set<ManifestData> manifests = new TreeSet<ManifestData>()
Set<LicenseFileData> licenseFiles = new HashSet<LicenseFileData>()
Set<PomData> poms = new HashSet<PomData>()
Set<LicenseFileData> licenseFiles = new TreeSet<LicenseFileData>()
Set<PomData> poms = new TreeSet<PomData>()

boolean isEmpty() { manifests.isEmpty() && poms.isEmpty() && licenseFiles.isEmpty() }
}
Expand All @@ -55,6 +55,7 @@ class ManifestData {
}

@Canonical
@Sortable(includes = ["name", "description", "projectUrl", "inceptionYear"])
class PomData {
String name, description, projectUrl, inceptionYear
Set<License> licenses = new TreeSet<License>()
Expand All @@ -81,6 +82,7 @@ class License {
}

@Canonical
@Sortable(excludes = "fileDetails")
class LicenseFileData {
Collection<LicenseFileDetails> fileDetails = new TreeSet<LicenseFileDetails>()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ class ProjectBuilderSpec extends Specification {
}

then:
data.configurations*.dependencies.flatten().licenseFiles.flatten().fileDetails.flatten()*.file == ["file1", "file2", "file3"]
data.configurations*.dependencies.flatten().licenseFiles.flatten().fileDetails.flatten()*.license == ["lic1", "lic2", "lic3"]
data.configurations*.dependencies.flatten().licenseFiles.flatten().fileDetails.flatten()*.licenseUrl == ["licUrl1", "licUrl2", "licUrl3"]
data.configurations*.dependencies.flatten().licenseFiles.flatten().fileDetails.flatten()*.file.sort() ==["file1", "file2", "file3"].sort()
data.configurations*.dependencies.flatten().licenseFiles.flatten().fileDetails.flatten()*.license.sort() == ["lic1", "lic2", "lic3"].sort()
data.configurations*.dependencies.flatten().licenseFiles.flatten().fileDetails.flatten()*.licenseUrl.sort() == ["licUrl1", "licUrl2", "licUrl3"].sort()
data.importedModules.isEmpty()
}

Expand Down

0 comments on commit 232fc7e

Please sign in to comment.