From 12a6ce1835db7124ab91c6839cabe3cb8bf69ed0 Mon Sep 17 00:00:00 2001 From: Jonathan Hoffman Date: Thu, 6 Jun 2024 16:53:58 -0400 Subject: [PATCH] Fixed failing tests --- .../CSVManifestFileServiceSpec.groovy | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/test/groovy/com/cloudcard/photoDownloader/CSVManifestFileServiceSpec.groovy b/src/test/groovy/com/cloudcard/photoDownloader/CSVManifestFileServiceSpec.groovy index 0c29e23..b33cd8f 100644 --- a/src/test/groovy/com/cloudcard/photoDownloader/CSVManifestFileServiceSpec.groovy +++ b/src/test/groovy/com/cloudcard/photoDownloader/CSVManifestFileServiceSpec.groovy @@ -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: "test@example.com"), bytes: null) | "test@example.com" - "non-existent property" | "person.nonExistentProperty" | new Photo(id: 1, person: new Person(identifier: "123", email: "test@example.com"), bytes: null) | null - "date property" | "dateCreated" | new Photo(id: 1, person: new Person(identifier: "123", email: "test@example.com"), 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: "test@example.com", 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: "test@example.com"), bytes: null) | null | "test@example.com" + "non-existent property" | "person.nonExistentProperty" | new Photo(id: 1, person: new Person(identifier: "123", email: "test@example.com"), bytes: null) | null | null + "date property" | "dateCreated" | new Photo(id: 1, person: new Person(identifier: "123", email: "test@example.com"), 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: "test@example.com", customFields: ["Full Name": "James"]), bytes: null) | null | "James" + "photo full file path" | "photo_fullFilePath" | new Photo(id: 1, person: new Person(identifier: "123", email: "test@example.com"), 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: "test@example.com"), bytes: null) | new PhotoFile("photo2", "photo2.jpg", 1) | "photo2.jpg" } def "test resolveFileName generates correct file name"() {