Skip to content

Commit 0937b0d

Browse files
committed
✅ Fix failing test after implementing fix for #32
After updating the code, I tested using the integration tests but failed to update the unit tests. The mocks needed to be updated to reflect the change in the code.
1 parent f472375 commit 0937b0d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

rest-services/client/src/test/java/com/_4point/aem/docservices/rest_services/client/forms/RestServicesFormsServiceAdapterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void testRenderPDFForm_HappyPaths(RenderFormsHappyPath codePath) throws Exceptio
180180
when(mockPayloadBuilder.addIfNotNull(eq("data"), codePath.hasData ? same(data) : isNull(), eq(ContentType.APPLICATION_XML))).thenReturn(mockPayloadBuilder);
181181
when(mockPayloadBuilder.addStringVersion(eq("renderOptions.acrobatVersion"), eq(pdfFormRenderOptions.getAcrobatVersion()))).thenReturn(mockPayloadBuilder);
182182
when(mockPayloadBuilder.addStringVersion(eq("renderOptions.cacheStrategy"), eq(pdfFormRenderOptions.getCacheStrategy()))).thenReturn(mockPayloadBuilder);
183-
when(mockPayloadBuilder.addStringVersion(eq("renderOptions.contentRoot"), eq(pdfFormRenderOptions.getContentRoot()))).thenReturn(mockPayloadBuilder);
183+
when(mockPayloadBuilder.addStringVersionOfPath(eq("renderOptions.contentRoot"), eq(pdfFormRenderOptions.getContentRoot()))).thenReturn(mockPayloadBuilder);
184184
when(mockPayloadBuilder.addStringVersion(eq("renderOptions.debugDir"), eq(pdfFormRenderOptions.getDebugDir()))).thenReturn(mockPayloadBuilder);
185185
when(mockPayloadBuilder.addStringVersion(eq("renderOptions.embedFonts"), eq(pdfFormRenderOptions.getEmbedFonts()))).thenReturn(mockPayloadBuilder);
186186
when(mockPayloadBuilder.addStringVersion(eq("renderOptions.locale"), eq(pdfFormRenderOptions.getLocale()))).thenReturn(mockPayloadBuilder);

rest-services/client/src/test/java/com/_4point/aem/docservices/rest_services/client/output/RestServicesOutputServiceAdapterTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void testGeneratePDFOutput_HappyPath(HappyPaths codePath) throws Exception {
185185

186186
// Setup the expected calls to mockPayloadBuilder
187187
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.acrobatVersion"), eq(AcrobatVersion.Acrobat_10_1))).thenReturn(mockPayloadBuilder);
188-
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.contentRoot"), Mockito.any(PathOrUrl.class))).thenReturn(mockPayloadBuilder);
188+
when(mockPayloadBuilder.addStringVersionOfPath(eq("outputOptions.contentRoot"), Mockito.any(PathOrUrl.class))).thenReturn(mockPayloadBuilder);
189189
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.debugDir"), Mockito.any(Path.class))).thenReturn(mockPayloadBuilder);
190190
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.embedFonts"), eq(Boolean.TRUE))).thenReturn(mockPayloadBuilder);
191191
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.linearizedPdf"), eq(Boolean.TRUE))).thenReturn(mockPayloadBuilder);
@@ -196,7 +196,7 @@ void testGeneratePDFOutput_HappyPath(HappyPaths codePath) throws Exception {
196196
when(mockPayloadBuilder.addIfNotNull(eq("outputOptions.xci"), Mockito.any(Document.class), eq(ContentType.APPLICATION_XML))).thenReturn(mockPayloadBuilder);
197197
} else {
198198
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.acrobatVersion"), isNull(AcrobatVersion.class))).thenReturn(mockPayloadBuilder);
199-
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.contentRoot"), isNull(PathOrUrl.class))).thenReturn(mockPayloadBuilder);
199+
when(mockPayloadBuilder.addStringVersionOfPath(eq("outputOptions.contentRoot"), isNull(PathOrUrl.class))).thenReturn(mockPayloadBuilder);
200200
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.debugDir"), isNull(Path.class))).thenReturn(mockPayloadBuilder);
201201
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.embedFonts"), eq(Boolean.FALSE))).thenReturn(mockPayloadBuilder);
202202
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.linearizedPdf"), eq(Boolean.FALSE))).thenReturn(mockPayloadBuilder);
@@ -226,7 +226,7 @@ void testGeneratePrintedOutput_HappyPath(HappyPaths codePath) throws Exception {
226226
when(printedOutputOptions.getXci()).thenReturn(Mockito.mock(Document.class));
227227

228228
// Setup the expected calls to mockPayloadBuilder
229-
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.contentRoot"), Mockito.any(PathOrUrl.class))).thenReturn(mockPayloadBuilder);
229+
when(mockPayloadBuilder.addStringVersionOfPath(eq("outputOptions.contentRoot"), Mockito.any(PathOrUrl.class))).thenReturn(mockPayloadBuilder);
230230
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.copies"), eq(Integer.valueOf(1)))).thenReturn(mockPayloadBuilder);
231231
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.debugDir"), Mockito.any(Path.class))).thenReturn(mockPayloadBuilder);
232232
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.locale"), eq(Locale.CANADA_FRENCH))).thenReturn(mockPayloadBuilder);
@@ -237,7 +237,7 @@ void testGeneratePrintedOutput_HappyPath(HappyPaths codePath) throws Exception {
237237
// Mandatory entry in PrintedOutputOptions.
238238
when(printedOutputOptions.getPrintConfig()).thenReturn(PrintConfig.HP_PCL_5e);
239239

240-
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.contentRoot"), isNull(PathOrUrl.class))).thenReturn(mockPayloadBuilder);
240+
when(mockPayloadBuilder.addStringVersionOfPath(eq("outputOptions.contentRoot"), isNull(PathOrUrl.class))).thenReturn(mockPayloadBuilder);
241241
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.copies"), eq(Integer.valueOf(0)))).thenReturn(mockPayloadBuilder);
242242
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.debugDir"), isNull(Path.class))).thenReturn(mockPayloadBuilder);
243243
when(mockPayloadBuilder.addStringVersion(eq("outputOptions.locale"), isNull(Locale.class))).thenReturn(mockPayloadBuilder);

0 commit comments

Comments
 (0)