Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void testDoCheckNetworkItemsValid() {

@Test
public void testDoFillSubnetworkItemsEmptyRegion() throws IOException {
DescriptorImpl descriptor = subnetworkFillDescriptorSetup(ImmutableList.of(SUBNETWORK_NAME));
DescriptorImpl descriptor = subnetworkFillDescriptorSetup2(ImmutableList.of(SUBNETWORK_NAME));
ListBoxModel got =
descriptor.doFillSubnetworkItems(r.jenkins, "", "", PROJECT_ID, CREDENTIALS_ID);
Assert.assertEquals(0, got.size());
Expand Down Expand Up @@ -160,4 +160,14 @@ private DescriptorImpl subnetworkFillDescriptorSetup(List<String> subnetworkName
DescriptorImpl.setComputeClient(computeClient);
return new DescriptorImpl();
}

private DescriptorImpl subnetworkFillDescriptorSetup2(List<String> subnetworkNames)
throws IOException {
List<Subnetwork> subnetworks = new ArrayList<>();
subnetworkNames.forEach(
subnet -> subnetworks.add(new Subnetwork().setName(subnet).setSelfLink(subnet)));
ComputeClient computeClient = Mockito.mock(ComputeClient.class);
DescriptorImpl.setComputeClient(computeClient);
return new DescriptorImpl();
}
}