Router.UpdateOptions updateOptions = Router.updateOptions()
.externalGatewayInfo(
ExternalGatewayInfo.builder().networkId("8ca37218-28ff-41cb-9b10-039601ea7e6b").build())
.build();
Router router = api.update("12345", updateOptions);
/*
* Check request
*/
assertAuthentication(server);
assertRequest(server.takeRequest(), "PUT", "/v2.0/routers/12345", "/router_update_request.json");
/*
* Check response
*/
assertNotNull(router);
assertEquals(router.getName(), "another_router");
assertEquals(router.getExternalGatewayInfo().getNetworkId(), "8ca37218-28ff-41cb-9b10-039601ea7e6b");
assertEquals(router.getStatus(), NetworkStatus.ACTIVE);
assertEquals(router.isAdminStateUp().booleanValue(), true);
assertEquals(router.getId(), "8604a0de-7f6b-409a-a47c-a1cc7bc77b2e");
assertEquals(router.getTenantId(), "6b96ff0cb17a4b859e1e575d221683d3");
} finally {
server.shutdown();
}
}