aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-adapters-rest-interface
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-adapters-rest-interface')
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java15
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java12
-rw-r--r--adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java9
3 files changed, 7 insertions, 29 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java
index 3e4d18cb1b..153ee78cb0 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java
@@ -54,7 +54,7 @@ public class CreateNetworkRequest extends NetworkRequestCommon {
private String networkType;
private String networkTypeVersion;
private String modelCustomizationUuid;
- private NetworkTechnology networkTechnology = NetworkTechnology.NEUTRON;
+ private String networkTechnology = "NEUTRON";
private List<Subnet> subnets;
private ProviderVlanNetwork providerVlanNetwork;
private ContrailNetwork contrailNetwork;
@@ -62,7 +62,6 @@ public class CreateNetworkRequest extends NetworkRequestCommon {
private Boolean backout = true;
private Map<String,String> networkParams = new HashMap<>();
private MsoRequest msoRequest = new MsoRequest();
- @JsonProperty
private boolean contrailRequest;
public CreateNetworkRequest() {
@@ -125,13 +124,12 @@ public class CreateNetworkRequest extends NetworkRequestCommon {
this.networkTypeVersion = networkTypeVersion;
}
- public NetworkTechnology getNetworkTechnology() {
+ public String getNetworkTechnology() {
return networkTechnology;
}
- public void setNetworkTechnology(NetworkTechnology networkTechnology) {
+ public void setNetworkTechnology(String networkTechnology) {
this.networkTechnology = networkTechnology;
- this.contrailRequest = determineContrail();
}
public List<Subnet> getSubnets() {
@@ -156,7 +154,6 @@ public class CreateNetworkRequest extends NetworkRequestCommon {
public void setContrailNetwork(ContrailNetwork contrailNetwork) {
this.contrailNetwork = contrailNetwork;
- this.contrailRequest = determineContrail();
}
public Boolean getFailIfExists() {
@@ -195,12 +192,8 @@ public class CreateNetworkRequest extends NetworkRequestCommon {
return this.contrailRequest;
}
- @JsonIgnore
- protected void setContrailRequest(boolean contrailRequest) {
+ public void setContrailRequest(boolean contrailRequest) {
this.contrailRequest = contrailRequest;
}
- private boolean determineContrail() {
- return (networkTechnology == NetworkTechnology.CONTRAIL && (contrailNetwork != null));
- }
}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java
index a7976840b7..595662251f 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java
@@ -52,7 +52,7 @@ public class UpdateNetworkRequest extends NetworkRequestCommon {
private String networkType;
private String networkTypeVersion;
private String modelCustomizationUuid;
- private NetworkTechnology networkTechnology = NetworkTechnology.NEUTRON;
+ private String networkTechnology = "NEUTRON";
private List<Subnet> subnets;
private ProviderVlanNetwork providerVlanNetwork;
private ContrailNetwork contrailNetwork;
@@ -130,13 +130,12 @@ public class UpdateNetworkRequest extends NetworkRequestCommon {
this.networkTypeVersion = networkTypeVersion;
}
- public NetworkTechnology getNetworkTechnology() {
+ public String getNetworkTechnology() {
return networkTechnology;
}
- public void setNetworkTechnology(NetworkTechnology networkTechnology) {
+ public void setNetworkTechnology(String networkTechnology) {
this.networkTechnology = networkTechnology;
- this.contrailRequest = determineContrail();
}
public List<Subnet> getSubnets() {
@@ -161,7 +160,6 @@ public class UpdateNetworkRequest extends NetworkRequestCommon {
public void setContrailNetwork(ContrailNetwork contrailNetwork) {
this.contrailNetwork = contrailNetwork;
- this.contrailRequest = determineContrail();
}
public Boolean getBackout() {
@@ -195,8 +193,4 @@ public class UpdateNetworkRequest extends NetworkRequestCommon {
return contrailRequest;
}
- private boolean determineContrail() {
- return (networkTechnology == NetworkTechnology.CONTRAIL && (contrailNetwork != null));
- }
-
}
diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java
index 08851c2ce9..5e04fc49ee 100644
--- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java
+++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java
@@ -38,13 +38,4 @@ public class NetworkRequestTest {
assertEquals(true, networkResponse.isSynchronous());
}
- @Test
- public void isContrailRequest() {
- CreateNetworkRequest networkResponse = new CreateNetworkRequest();
- assertEquals(false, networkResponse.isContrailRequest());
- networkResponse.setNetworkTechnology(NetworkTechnology.CONTRAIL);
- assertEquals(false, networkResponse.isContrailRequest());
- networkResponse.setContrailNetwork(new ContrailNetwork());
- assertEquals(true, networkResponse.isContrailRequest());
- }
}