}
public void testConnectionFailsSafely() throws Exception {
when(serializer.serialize(BUNDLE, PROTOCOL_VERSION)).thenReturn(SERIALIZED_BUNDLE);
when(connection.postJson(TEST_RPC_ENDPOINT, SERIALIZED_BUNDLE)).thenThrow(
new RobotConnectionException("Connection Failed"));
List<OperationRequest> operations =
connector.sendMessageBundle(BUNDLE, robot, PROTOCOL_VERSION);
assertTrue("Expected no operations to be returned", operations.isEmpty());
}