The Tinkerforge library throws TimeoutException and NotConnectedException (among others). I'd like to throw these in my test case, so I can test that my error-handling code works correctly.
When I try
when(brickletLEDStripMock.getRGBValues(any(), any())).thenThrow(new NotConnectedException("Test"));
IntelliJ tells me that the exception is not public and cannot be accessed from outside the package.
Is there a way to throw it anyway, maybe with Powermock?
Aucun commentaire:
Enregistrer un commentaire