You should also mock the next() method to have it return true the first time it’s called, as mockito will return false by default.
Mockito.when(resultSetMock.next()).thenReturn(true).thenReturn(false);
You should also mock the next() method to have it return true the first time it’s called, as mockito will return false by default.
Mockito.when(resultSetMock.next()).thenReturn(true).thenReturn(false);