I have following code in my unit test:
when(workspaceMock.getNamespaceRegistry()).thenReturn(namespaceRegistryMock);
method getNamespaceRegistry can throws IOException
In terms of java mentioned row is method call and I should to catch it.
But on another hand I understand that this method cannot throw exception because I set this method behaviour there. And it is looks redundant to catch exception here.
Can you clarify this situation and advise best practises?
Aucun commentaire:
Enregistrer un commentaire