Skip to content

Commit

Permalink
Update NetworkOrchestratorTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
gzhao9 authored Oct 10, 2023
1 parent c3aeba1 commit ee25fac
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public class NetworkOrchestratorTest extends TestCase {
private String guruName = "GuestNetworkGuru";
private String dhcpProvider = "VirtualRouter";
private NetworkGuru guru = mock(NetworkGuru.class);
private Network network;

NetworkOfferingVO networkOffering = mock(NetworkOfferingVO.class);

Expand All @@ -111,6 +112,7 @@ public class NetworkOrchestratorTest extends TestCase {
@Before
public void setUp() {
// make class-scope mocks
network = mock(Network.class);
testOrchastrator._nicDao = mock(NicDao.class);
testOrchastrator._networksDao = mock(NetworkDao.class);
testOrchastrator._networkModel = mock(NetworkModel.class);
Expand Down Expand Up @@ -242,7 +244,7 @@ public void testCheckL2OfferingServicesMultipleServicesNotIncludingUserData() {

@Test
public void testConfigureNicProfileBasedOnRequestedIpTestMacNull() {
Network network = mock(Network.class);

NicProfile requestedNicProfile = new NicProfile();
NicProfile nicProfile = Mockito.spy(new NicProfile());

Expand All @@ -256,7 +258,7 @@ public void testConfigureNicProfileBasedOnRequestedIpTestMacNull() {

@Test
public void testConfigureNicProfileBasedOnRequestedIpTestNicProfileMacNotNull() {
Network network = mock(Network.class);

NicProfile requestedNicProfile = new NicProfile();
NicProfile nicProfile = Mockito.spy(new NicProfile());

Expand Down Expand Up @@ -284,7 +286,7 @@ public void testConfigureNicProfileBasedOnRequestedIpTestRequestedIpIsNotValid()
}

private void testConfigureNicProfileBasedOnRequestedIpTestRequestedIp(String requestedIpv4Address) {
Network network = mock(Network.class);

NicProfile requestedNicProfile = new NicProfile();
NicProfile nicProfile = Mockito.spy(new NicProfile());

Expand All @@ -311,7 +313,7 @@ public void testConfigureNicProfileBasedOnRequestedIpTestGatewayIsNull() {
}

private void testConfigureNicProfileBasedOnRequestedIpTestGateway(String ipv4Gateway) {
Network network = mock(Network.class);

NicProfile requestedNicProfile = new NicProfile();
NicProfile nicProfile = Mockito.spy(new NicProfile());

Expand All @@ -337,7 +339,7 @@ public void testConfigureNicProfileBasedOnRequestedIpTestNetmaskIsNotValid() {
}

private void testConfigureNicProfileBasedOnRequestedIpTestNetmask(String ipv4Netmask) {
Network network = mock(Network.class);

NicProfile requestedNicProfile = new NicProfile();
NicProfile nicProfile = Mockito.spy(new NicProfile());

Expand All @@ -349,7 +351,7 @@ private void testConfigureNicProfileBasedOnRequestedIpTestNetmask(String ipv4Net

@Test(expected = InvalidParameterValueException.class)
public void testConfigureNicProfileBasedOnRequestedIpTestIPAddressVONull() {
Network network = mock(Network.class);

NicProfile requestedNicProfile = new NicProfile();
NicProfile nicProfile = Mockito.spy(new NicProfile());

Expand Down

0 comments on commit ee25fac

Please sign in to comment.