.build();
OrgNetwork editNetwork = getMutatedOrgNetwork(oldNetwork);
try {
Task editNetworkTask = networkApi.edit(networkUrn, editNetwork);
Checks.checkTask(editNetworkTask);
assertTrue(retryTaskSuccess.apply(editNetworkTask), String.format(TASK_COMPLETE_TIMELY, "editNetworkTask"));
network = networkApi.get(networkUrn);
Checks.checkOrgNetwork(Network.<OrgNetwork>toSubType(network));
assertTrue(equal(network.getConfiguration().getIpScope(),
editNetwork.getConfiguration().getIpScope()),
String.format(OBJ_FIELD_UPDATABLE, NETWORK+".configuration", "ipScope"));
assertTrue(equal(network.getConfiguration().getParentNetwork(),
editNetwork.getConfiguration().getParentNetwork()),
String.format(OBJ_FIELD_UPDATABLE, NETWORK+".configuration", "parentNetwork"));
assertTrue(equal(network.getConfiguration().getFenceMode(),
editNetwork.getConfiguration().getFenceMode()),
String.format(OBJ_FIELD_UPDATABLE, NETWORK+".configuration", "fenceMode"));
assertTrue(equal(network.getConfiguration().retainNetInfoAcrossDeployments(),
editNetwork.getConfiguration().retainNetInfoAcrossDeployments()),
String.format(OBJ_FIELD_UPDATABLE, NETWORK+".configuration", "retainNetInfoAcrossDeployments"));
assertTrue(equal(network.getConfiguration().getNetworkFeatures(),
editNetwork.getConfiguration().getNetworkFeatures()),
String.format(OBJ_FIELD_UPDATABLE, NETWORK+".configuration", "networkFeatures"));
assertTrue(equal(network.getConfiguration().getSyslogServerSettings(),
editNetwork.getConfiguration().getSyslogServerSettings()),
String.format(OBJ_FIELD_UPDATABLE, NETWORK+".configuration", "syslogServerSettings"));
assertTrue(equal(network.getConfiguration().getRouterInfo(),
editNetwork.getConfiguration().getRouterInfo()),
String.format(OBJ_FIELD_UPDATABLE, NETWORK+".configuration", "routerInfo"));
// FIXME: fails
// assertTrue(equal(Network.<OrgNetwork>toSubType(network).getNetworkPool(),
// editNetwork.getNetworkPool()),
// String.format(OBJ_FIELD_UPDATABLE, NETWORK, "networkPool"));
// assertTrue(equal(Network.<OrgNetwork>toSubType(network).getAllowedExternalIpAddresses(),
// editNetwork.getAllowedExternalIpAddresses()),
// String.format(OBJ_FIELD_UPDATABLE, NETWORK, "allowedExternalIpAddresses"));
} finally {
Task editNetworkTask = networkApi.edit(networkUrn, oldNetwork);
Checks.checkTask(editNetworkTask);
assertTrue(retryTaskSuccess.apply(editNetworkTask), String.format(TASK_COMPLETE_TIMELY, "editNetworkTask"));
network = networkApi.get(networkUrn);
}
}