*/
@Override
public int canCreateNetwork(NeutronNetwork network) {
- if (network.isShared() && !network.getRouterExternal()) {
- LOG.error("Shared attribute is only supported on external networks");
- return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
- }
-
return HttpURLConnection.HTTP_OK;
}
@Override
public int canUpdateNetwork(NeutronNetwork delta,
NeutronNetwork original) {
- if (delta.isShared() && !delta.getRouterExternal()) {
- LOG.error("Shared attribute is only supported on external networks");
- return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
- }
-
return HttpURLConnection.HTTP_OK;
}
*/
@Test
public void testCanCreateNetwork() {
- assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_NOT_ACCEPTABLE, networkHandler.canCreateNetwork(sharedNeutronNetwork));
+ assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canCreateNetwork(sharedNeutronNetwork));
assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canCreateNetwork(nonSharedNeutronNetwork));
}
*/
@Test
public void testCanUpdateNetwork() {
- assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_NOT_ACCEPTABLE, networkHandler.canUpdateNetwork(sharedNeutronNetwork, sharedNeutronNetwork));
+ assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canUpdateNetwork(sharedNeutronNetwork, sharedNeutronNetwork));
assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canUpdateNetwork(nonSharedNeutronNetwork, nonSharedNeutronNetwork));
}