This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch netris-integration-upstream
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 4956cd819632ae4dc961a3d862b84f28087fbb32
Author: Nicolas Vazquez <nicovazque...@gmail.com>
AuthorDate: Mon Dec 9 14:37:16 2024 +0100

    Fix unit tests (#30)
---
 .../cloudstack/service/NetrisServiceMockTest.java  | 79 ++++++++++++++++++++++
 .../src/test/resources/createNetworkOffering.xml   |  1 +
 2 files changed, 80 insertions(+)

diff --git 
a/server/src/test/java/org/apache/cloudstack/service/NetrisServiceMockTest.java 
b/server/src/test/java/org/apache/cloudstack/service/NetrisServiceMockTest.java
new file mode 100644
index 00000000000..e0abcef63ba
--- /dev/null
+++ 
b/server/src/test/java/org/apache/cloudstack/service/NetrisServiceMockTest.java
@@ -0,0 +1,79 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.service;
+
+import com.cloud.network.IpAddress;
+import com.cloud.network.SDNProviderNetworkRule;
+import com.cloud.network.netris.NetrisService;
+import com.cloud.network.vpc.Vpc;
+
+public class NetrisServiceMockTest implements NetrisService {
+    @Override
+    public boolean createIPAMAllocationsForZoneLevelPublicRanges(long zoneId) {
+        return true;
+    }
+
+    @Override
+    public boolean createVpcResource(long zoneId, long accountId, long 
domainId, Long vpcId, String vpcName, boolean sourceNatEnabled, String cidr, 
boolean isVpcNetwork) {
+        return true;
+    }
+
+    @Override
+    public boolean deleteVpcResource(long zoneId, long accountId, long 
domainId, Vpc vpc) {
+        return true;
+    }
+
+    @Override
+    public boolean createVnetResource(Long zoneId, long accountId, long 
domainId, String vpcName, Long vpcId, String networkName, Long networkId, 
String cidr) {
+        return true;
+    }
+
+    @Override
+    public boolean deleteVnetResource(long zoneId, long accountId, long 
domainId, String vpcName, Long vpcId, String networkName, Long networkId, 
String cidr) {
+        return true;
+    }
+
+    @Override
+    public boolean createSnatRule(long zoneId, long accountId, long domainId, 
String vpcName, long vpcId, String networkName, long networkId, boolean 
isForVpc, String vpcCidr, String sourceNatIp) {
+        return true;
+    }
+
+    @Override
+    public boolean createPortForwardingRule(long zoneId, long accountId, long 
domainId, String vpcName, long vpcId, String networkName, Long networkId, 
boolean isForVpc, String vpcCidr, SDNProviderNetworkRule networkRule) {
+        return true;
+    }
+
+    @Override
+    public boolean deletePortForwardingRule(long zoneId, long accountId, long 
domainId, String vpcName, Long vpcId, String networkName, Long networkId, 
boolean isForVpc, String vpcCidr, SDNProviderNetworkRule networkRule) {
+        return true;
+    }
+
+    @Override
+    public boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address) {
+        return true;
+    }
+
+    @Override
+    public boolean createStaticNatRule(long zoneId, long accountId, long 
domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, 
String vpcCidr, String staticNatIp, String vmIp) {
+        return true;
+    }
+
+    @Override
+    public boolean deleteStaticNatRule(long zoneId, long accountId, long 
domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, 
String staticNatIp) {
+        return true;
+    }
+}
diff --git a/server/src/test/resources/createNetworkOffering.xml 
b/server/src/test/resources/createNetworkOffering.xml
index 17afd500191..4af7802dcdf 100644
--- a/server/src/test/resources/createNetworkOffering.xml
+++ b/server/src/test/resources/createNetworkOffering.xml
@@ -74,6 +74,7 @@
     <bean id="configurationSubGroupDaoImpl" 
class="org.apache.cloudstack.framework.config.dao.ConfigurationSubGroupDaoImpl" 
/>
     <bean id="nsxControllerDaoImpl" 
class="com.cloud.network.dao.NsxProviderDaoImpl" />
     <bean id="netrisProviderDaoImpl" 
class="com.cloud.network.dao.NetrisProviderDaoImpl" />
+    <bean id="netrisServiceMock" 
class="org.apache.cloudstack.service.NetrisServiceMockTest" />
     <bean id="vlanDetailsDao" class="com.cloud.dc.dao.VlanDetailsDaoImpl" />
     <bean id="publicIpQuarantineDaoImpl" 
class="com.cloud.network.dao.PublicIpQuarantineDaoImpl" />
     <bean id="reservationDao" 
class="org.apache.cloudstack.reservation.dao.ReservationDaoImpl" />

Reply via email to