public void testUpdateAttributeViaPersistence_shouldNotOverwrite() throws Exception {
File connectorFile = temporaryFolder.newFile(TEST_FILE_NAME);
FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
"property.foo=bar", "attribute.x=y"));
connectorDeployerService.install(connectorFile);
ConnectorDescription desc = serviceManager.getAttributeValues(testConnectorId);
ConnectorDescription newDesc = new ConnectorDescription("mydomain", "aconnector",
ImmutableMap.of("x", "z"), desc.getProperties());
serviceManager.update(testConnectorId, newDesc);
FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
"property.foo=bar", "attribute.x=y", "property.x=y"));
connectorDeployerService.update(connectorFile);
ConnectorDescription attributeValues = serviceManager.getAttributeValues(testConnectorId);
assertThat(attributeValues.getAttributes().get("x"), is("z"));
}