Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hoffman committed Jun 6, 2024
1 parent 5ce6c95 commit 12a6ce1
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,19 @@ class CSVManifestFileServiceSpec extends Specification {
csvManifestFileService.dateFormat = "yyyy-MM-dd"

when:
def result = csvManifestFileService.resolveValue(column, photo)
def result = csvManifestFileService.resolveValue(column, photo, photoFile)

then:
result == expectedResult
where:
description | column | photo | expectedResult
"static column" | "static_CloudCard" | null | "CloudCard"
"nested property" | "person.email" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]"), bytes: null) | "[email protected]"
"non-existent property" | "person.nonExistentProperty" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]"), bytes: null) | null
"date property" | "dateCreated" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]"), bytes: null, dateCreated: parseDate("Fri Feb 16 11:41:44 EST 2024")) | "2024-02-16"
"custom Field property" | "person.customFields.Full Name" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]", customFields: ["Full Name": "James"]), bytes: null) | "James"
description | column | photo | photoFile | expectedResult
"static column" | "static_CloudCard" | null | null | "CloudCard"
"nested property" | "person.email" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]"), bytes: null) | null | "[email protected]"
"non-existent property" | "person.nonExistentProperty" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]"), bytes: null) | null | null
"date property" | "dateCreated" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]"), bytes: null, dateCreated: parseDate("Fri Feb 16 11:41:44 EST 2024")) | null | "2024-02-16"
"custom Field property" | "person.customFields.Full Name" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]", customFields: ["Full Name": "James"]), bytes: null) | null | "James"
"photo full file path" | "photo_fullFilePath" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]"), bytes: null) | new PhotoFile("photo1", "/Users/Calvin/downloaded-photos/photo1.jpg", 1) | "/Users/Calvin/downloaded-photos/photo1.jpg"
"photo file name" | "photo_fileName" | new Photo(id: 1, person: new Person(identifier: "123", email: "[email protected]"), bytes: null) | new PhotoFile("photo2", "photo2.jpg", 1) | "photo2.jpg"
}

def "test resolveFileName generates correct file name"() {
Expand Down

0 comments on commit 12a6ce1

Please sign in to comment.