when(factory.getValidationErrors(any(Connector.class), anyMap())).thenReturn(errorMessages);
Map<String, String> attributes = new HashMap<String, String>();
Map<String, Object> properties = new Hashtable<String, Object>();
properties.put("foo", "bar");
ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);
String connectorId = connectorManager.create(connectorDescription);
serviceUtils.getService("(foo=bar)", 1L);
connectorDescription.getProperties().put("foo", "42");
try {
connectorManager.update(connectorId, connectorDescription);
fail("Exception expected");
} catch (RuntimeException e) {
assertThat(((ConnectorValidationFailedException) e.getCause()).getErrorMessages(), is(errorMessages));