config.setReadBufferSize(1234);
verify(socket).setReceiveBufferSize(eq(1234));
verifyNoMoreInteractions(socket);
// handle error
when(socket.getReceiveBufferSize()).thenThrow(new SocketException("test"));
try {
config.getReadBufferSize();
fail();
} catch (ConfigurationException e) {
assertEquals("test", e.getCause().getMessage());
}
// handle error
doThrow(new SocketException("test")).when(socket).setReceiveBufferSize(eq(1234));
try {
config.setReadBufferSize(1234);
fail();
} catch (ConfigurationException e) {
assertEquals("test", e.getCause().getMessage());