-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonathan Hoffman
committed
Jun 6, 2024
1 parent
5ce6c95
commit 12a6ce1
Showing
1 changed file
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"() { | ||
|