@@ -57,7 +57,7 @@ public class XHtmlToConfluenceServiceImplTest {
57
57
58
58
private static final String POST_RESPONSE = "{\" id\" :\" 1\" }" ;
59
59
60
- private static final List <Integer > CATEGORY_INDEXES = Arrays .asList (1 , 6 , 25 );
60
+ private static final List <Integer > CATEGORY_INDEXES = Arrays .asList (1 , 6 , 25 , 31 );
61
61
62
62
@ Mock
63
63
private RestTemplate restTemplate ;
@@ -158,7 +158,7 @@ public void testCreatePageWithPaginationModeCategory(){
158
158
"/swagger-petstore-xhtml-example.html" )
159
159
);
160
160
161
- for (int i = 0 ; i < 4 ; i ++) {
161
+ for (int i = 0 ; i < 5 ; i ++) {
162
162
when (restTemplate .exchange (any (URI .class ), eq (HttpMethod .GET ),
163
163
any (RequestEntity .class ), eq (String .class ))).thenReturn (responseEntity );
164
164
when (responseEntity .getBody ()).thenReturn (GET_RESPONSE_NOT_FOUND );
@@ -171,12 +171,12 @@ public void testCreatePageWithPaginationModeCategory(){
171
171
172
172
xHtmlToConfluenceService .postXHtmlToConfluence (swaggerConfluenceConfig , xhtml );
173
173
174
- verify (restTemplate , times (4 )).exchange (any (URI .class ), eq (HttpMethod .GET ),
174
+ verify (restTemplate , times (5 )).exchange (any (URI .class ), eq (HttpMethod .GET ),
175
175
any (RequestEntity .class ), eq (String .class ));
176
- verify (restTemplate , times (4 )).exchange (any (URI .class ), eq (HttpMethod .POST ),
176
+ verify (restTemplate , times (5 )).exchange (any (URI .class ), eq (HttpMethod .POST ),
177
177
httpEntityCaptor .capture (), eq (String .class ));
178
178
179
- final HttpEntity <String > capturedHttpEntity = httpEntityCaptor .getValue ( );
179
+ final HttpEntity <String > capturedHttpEntity = httpEntityCaptor .getAllValues (). get ( 3 );
180
180
181
181
final String expectedPostBody = IOUtils .readFull (
182
182
AsciiDocToXHtmlServiceImplTest .class .getResourceAsStream (
@@ -201,7 +201,7 @@ public void testUpdatePageWithPaginationModeCategory(){
201
201
202
202
final ResponseEntity <String > postResponseEntity = new ResponseEntity <>(POST_RESPONSE , HttpStatus .OK );
203
203
204
- for (int i = 0 ; i < 4 ; i ++) {
204
+ for (int i = 0 ; i < 5 ; i ++) {
205
205
when (restTemplate .exchange (any (URI .class ), eq (HttpMethod .GET ),
206
206
any (RequestEntity .class ), eq (String .class ))).thenReturn (responseEntity );
207
207
when (responseEntity .getBody ()).thenReturn (GET_RESPONSE_FOUND );
@@ -213,12 +213,12 @@ public void testUpdatePageWithPaginationModeCategory(){
213
213
214
214
xHtmlToConfluenceService .postXHtmlToConfluence (swaggerConfluenceConfig , xhtml );
215
215
216
- verify (restTemplate , times (4 )).exchange (any (URI .class ), eq (HttpMethod .GET ),
216
+ verify (restTemplate , times (5 )).exchange (any (URI .class ), eq (HttpMethod .GET ),
217
217
any (RequestEntity .class ), eq (String .class ));
218
- verify (restTemplate , times (4 )).exchange (any (URI .class ), eq (HttpMethod .PUT ),
218
+ verify (restTemplate , times (5 )).exchange (any (URI .class ), eq (HttpMethod .PUT ),
219
219
httpEntityCaptor .capture (), eq (String .class ));
220
220
221
- final HttpEntity <String > capturedHttpEntity = httpEntityCaptor .getValue ( );
221
+ final HttpEntity <String > capturedHttpEntity = httpEntityCaptor .getAllValues (). get ( 3 );
222
222
223
223
final String expectedPostBody = IOUtils .readFull (
224
224
AsciiDocToXHtmlServiceImplTest .class .getResourceAsStream (
@@ -254,12 +254,12 @@ public void testCreatePageWithPaginationModeIndividual(){
254
254
255
255
xHtmlToConfluenceService .postXHtmlToConfluence (swaggerConfluenceConfig , xhtml );
256
256
257
- verify (restTemplate , times (31 )).exchange (any (URI .class ), eq (HttpMethod .GET ),
257
+ verify (restTemplate , times (34 )).exchange (any (URI .class ), eq (HttpMethod .GET ),
258
258
any (RequestEntity .class ), eq (String .class ));
259
- verify (restTemplate , times (31 )).exchange (any (URI .class ), eq (HttpMethod .POST ),
259
+ verify (restTemplate , times (34 )).exchange (any (URI .class ), eq (HttpMethod .POST ),
260
260
httpEntityCaptor .capture (), eq (String .class ));
261
261
262
- final HttpEntity <String > capturedHttpEntity = httpEntityCaptor .getValue ( );
262
+ final HttpEntity <String > capturedHttpEntity = httpEntityCaptor .getAllValues (). get ( 30 );
263
263
264
264
final String expectedPostBody = IOUtils .readFull (
265
265
AsciiDocToXHtmlServiceImplTest .class .getResourceAsStream (
@@ -289,7 +289,7 @@ public void testUpdatePageWithPaginationModeIndividual(){
289
289
when (restTemplate .exchange (any (URI .class ), eq (HttpMethod .GET ),
290
290
any (RequestEntity .class ), eq (String .class ))).thenReturn (responseEntity );
291
291
292
- for (int i = 0 ; i < 31 ; i ++) {
292
+ for (int i = 0 ; i < 34 ; i ++) {
293
293
if (i > 0 ) {
294
294
returnJson .add (GET_RESPONSE_FOUND );
295
295
}
@@ -315,12 +315,12 @@ public void testUpdatePageWithPaginationModeIndividual(){
315
315
316
316
xHtmlToConfluenceService .postXHtmlToConfluence (swaggerConfluenceConfig , xhtml );
317
317
318
- verify (restTemplate , times (34 )).exchange (any (URI .class ), eq (HttpMethod .GET ),
318
+ verify (restTemplate , times (38 )).exchange (any (URI .class ), eq (HttpMethod .GET ),
319
319
any (RequestEntity .class ), eq (String .class ));
320
- verify (restTemplate , times (31 )).exchange (any (URI .class ), eq (HttpMethod .PUT ),
320
+ verify (restTemplate , times (34 )).exchange (any (URI .class ), eq (HttpMethod .PUT ),
321
321
httpEntityCaptor .capture (), eq (String .class ));
322
322
323
- final HttpEntity <String > capturedHttpEntity = httpEntityCaptor .getValue ( );
323
+ final HttpEntity <String > capturedHttpEntity = httpEntityCaptor .getAllValues (). get ( 30 );
324
324
325
325
final String expectedPostBody = IOUtils .readFull (
326
326
AsciiDocToXHtmlServiceImplTest .class .getResourceAsStream (
0 commit comments