File tree Expand file tree Collapse file tree
src/test/java/com/github/fge/jsonpatch Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929
3030import java .io .IOException ;
3131import java .util .ArrayList ;
32+ import java .util .Arrays ;
3233import java .util .List ;
3334
3435import static org .mockito .Mockito .*;
@@ -91,9 +92,7 @@ public void operationsAreCalledInOrder()
9192
9293 when (op1 .apply (node1 )).thenReturn (node2 );
9394
94- List <JsonPatchOperation > jsonPatchOperationList = new ArrayList <JsonPatchOperation >();
95- jsonPatchOperationList .add (op1 );
96- jsonPatchOperationList .add (op2 );
95+ List <JsonPatchOperation > jsonPatchOperationList = Arrays .asList (op1 , op2 );
9796 final JsonPatch patch = new JsonPatch (jsonPatchOperationList );
9897
9998 final ArgumentCaptor <JsonNode > captor
@@ -114,9 +113,7 @@ public void whenOneOperationFailsNextOperationIsNotCalled()
114113 when (op1 .apply (any (JsonNode .class )))
115114 .thenThrow (new JsonPatchException (message ));
116115
117- List <JsonPatchOperation > jsonPatchOperationList = new ArrayList <JsonPatchOperation >();
118- jsonPatchOperationList .add (op1 );
119- jsonPatchOperationList .add (op2 );
116+ List <JsonPatchOperation > jsonPatchOperationList = Arrays .asList (op1 , op2 );
120117 final JsonPatch patch = new JsonPatch (jsonPatchOperationList );
121118
122119 try {
You can’t perform that action at this time.
0 commit comments