I have a backend system which we use a third-party Java API to access from our own applications. I can access the system as a normal user along with other users, but I do no
you could look into 'Mockito'
Example:
//You can mock concrete classes, not only interfaces LinkedList mockedList = mock(LinkedList.class); //stubbing when(mockedList.get(0)).thenReturn("first"); when(mockedList.get(1)).thenThrow(new RuntimeException()); //following prints "first" System.out.println(mockedList.get(0)); //following throws runtime exception System.out.println(mockedList.get(1)); //following prints "null" because get(999) was not stubbed System.out.println(mockedList.get(999));
after you could replay each test more times and it will return data that you put in.