File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
src/test/java/com/microsoft/graph/http Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 11package com .microsoft .graph .http ;
22
3+ import static org .junit .jupiter .api .Assertions .*;
34import static org .mockito .Mockito .mock ;
45
5- import static org .junit .jupiter .api .Assertions .assertEquals ;
6- import static org .junit .jupiter .api .Assertions .assertNotNull ;
7- import static org .junit .jupiter .api .Assertions .assertTrue ;
8-
96import java .util .ArrayList ;
107
118import org .junit .jupiter .api .BeforeEach ;
@@ -48,13 +45,11 @@ public void testNotNull() {
4845 public void testCurrentPage () {
4946 assertEquals (3 ,baseCollectionPage .getCurrentPage ().size ());
5047 assertEquals ("Object2" , baseCollectionPage .getCurrentPage ().get (1 ));
51- Boolean success = false ;
52- try {
53- baseCollectionPage .getCurrentPage ().remove (1 );
54- }catch (UnsupportedOperationException uEx ){
55- success = true ;
56- }
57- assertTrue (success );
48+
49+ //Test to ensure the returned list from getCurrentPage is a deep copy of baseCollectionPage contents.
50+ ArrayList <String > baseCollectionContentsCopy = (ArrayList <String >) baseCollectionPage .getCurrentPage ();
51+ baseCollectionContentsCopy .remove (1 );
52+ assertNotEquals (baseCollectionPage .getCurrentPage ().size (), baseCollectionContentsCopy .size ());
5853 }
5954
6055 @ Test
You can’t perform that action at this time.
0 commit comments