@Test public void succeedsToGet() throws Throwable { String networkId = UUID.randomUUID().toString(); VirtualNetworkService.State virtualNetworkState = createVirtualNetworkState(networkId); Operation operation = new Operation(); operation.setBody(virtualNetworkState); doReturn(operation).when(cloudStoreClient).get(virtualNetworkState.documentSelfLink); VirtualSubnet virtualSubnet = frontendClient.get(networkId); assertEquals(virtualSubnet.getName(), virtualNetworkState.name); assertTrue(CollectionUtils.isEqualCollection(virtualSubnet.getReservedIpList(), virtualNetworkState.reservedIpList.values())); }
public VirtualSubnet get(String networkId) throws ExternalException { VirtualNetworkService.State virtualNetworkState = getNetworkById(networkId); if (virtualNetworkState == null) { throw new NetworkNotFoundException(networkId); } return VirtualNetworkUtils.convert(virtualNetworkState); }
VirtualNetworkFeClient { public VirtualSubnet get(String networkId) throws ExternalException { VirtualNetworkService.State virtualNetworkState = getNetworkById(networkId); if (virtualNetworkState == null) { throw new NetworkNotFoundException(networkId); } return VirtualNetworkUtils.convert(virtualNetworkState); } }
VirtualNetworkFeClient { public VirtualSubnet get(String networkId) throws ExternalException { VirtualNetworkService.State virtualNetworkState = getNetworkById(networkId); if (virtualNetworkState == null) { throw new NetworkNotFoundException(networkId); } return VirtualNetworkUtils.convert(virtualNetworkState); } @Inject  VirtualNetworkFeClient(PhotonControllerXenonRestClient photonControllerXenonRestClient,
                                ApiFeXenonRestClient cloudStoreClient, TaskBackend taskBackend); }
VirtualNetworkFeClient { public VirtualSubnet get(String networkId) throws ExternalException { VirtualNetworkService.State virtualNetworkState = getNetworkById(networkId); if (virtualNetworkState == null) { throw new NetworkNotFoundException(networkId); } return VirtualNetworkUtils.convert(virtualNetworkState); } @Inject  VirtualNetworkFeClient(PhotonControllerXenonRestClient photonControllerXenonRestClient,
                                ApiFeXenonRestClient cloudStoreClient, TaskBackend taskBackend); Task create(String parentId,
                     String parentKind,
                     VirtualNetworkCreateSpec spec); Task delete(String networkId); VirtualSubnet get(String networkId); ResourceList<VirtualSubnet> list(String parentId,
                                          String parentKind,
                                          Optional<String> name,
                                          Optional<Integer> pageSize); ResourceList<VirtualSubnet> nextList(String pageLink); Task setDefault(String networkId); }
VirtualNetworkFeClient { public VirtualSubnet get(String networkId) throws ExternalException { VirtualNetworkService.State virtualNetworkState = getNetworkById(networkId); if (virtualNetworkState == null) { throw new NetworkNotFoundException(networkId); } return VirtualNetworkUtils.convert(virtualNetworkState); } @Inject  VirtualNetworkFeClient(PhotonControllerXenonRestClient photonControllerXenonRestClient,
                                ApiFeXenonRestClient cloudStoreClient, TaskBackend taskBackend); Task create(String parentId,
                     String parentKind,
                     VirtualNetworkCreateSpec spec); Task delete(String networkId); VirtualSubnet get(String networkId); ResourceList<VirtualSubnet> list(String parentId,
                                          String parentKind,
                                          Optional<String> name,
                                          Optional<Integer> pageSize); ResourceList<VirtualSubnet> nextList(String pageLink); Task setDefault(String networkId); static final int DEFAULT_RESERVED_IP_LIST_SIZE; }