summaryrefslogtreecommitdiffstats
path: root/nova-model/src
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@att.com>2020-04-03 16:38:20 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-04-03 16:49:34 -0400
commit492a7c0434170d29c2b45d81e0c96fc940b754d0 (patch)
tree3d065d90483055cc133295bcc87d610b73ad0c2f /nova-model/src
parentd313b58558c9c6d30ea66132b16949b7f7063cc3 (diff)
version should not be a string
Issue-ID: SO-2786 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: Id4065c5138a93abf3ffcb4c744e784d6b683fe5e
Diffstat (limited to 'nova-model/src')
-rw-r--r--nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java6
-rw-r--r--nova-model/src/test/java/com/woorea/openstack/nova/model/AddressTest.java7
-rw-r--r--nova-model/src/test/java/com/woorea/openstack/nova/model/ServerTest.java15
-rw-r--r--nova-model/src/test/java/com/woorea/openstack/nova/model/ServersTest.java16
4 files changed, 21 insertions, 23 deletions
diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java
index 0226218..90b2fe2 100644
--- a/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java
+++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java
@@ -35,7 +35,7 @@ public class Server implements Serializable {
@JsonProperty("OS-EXT-IPS-MAC:mac_addr")
private String macAddr;
- private String version;
+ private int version;
private String addr;
@@ -52,7 +52,7 @@ public class Server implements Serializable {
/**
* @return the version
*/
- public String getVersion() {
+ public int getVersion() {
return version;
}
@@ -74,7 +74,7 @@ public class Server implements Serializable {
/**
* @param version the version to set
*/
- public void setVersion(String version) {
+ public void setVersion(int version) {
this.version = version;
}
diff --git a/nova-model/src/test/java/com/woorea/openstack/nova/model/AddressTest.java b/nova-model/src/test/java/com/woorea/openstack/nova/model/AddressTest.java
index 70bfc8f..6bca2fb 100644
--- a/nova-model/src/test/java/com/woorea/openstack/nova/model/AddressTest.java
+++ b/nova-model/src/test/java/com/woorea/openstack/nova/model/AddressTest.java
@@ -34,9 +34,8 @@ public class AddressTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL + " \"version\" : \"version\"," + EOL + " \"addr\" : \"addr\","
- + EOL + " \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL + " \"OS-EXT-IPS:type\" : \"type\"" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"version\" : 4," + EOL + " \"addr\" : \"addr\"," + EOL
+ + " \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL + " \"OS-EXT-IPS:type\" : \"type\"" + EOL + "}";
private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
.enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
@@ -65,7 +64,7 @@ public class AddressTest {
Assert.assertNotNull(addr);
address.setAddr(addr);
- String version = address.getVersion();
+ int version = address.getVersion();
Assert.assertNotNull(version);
address.setVersion(version);
diff --git a/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerTest.java b/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerTest.java
index 62212ee..87789ff 100644
--- a/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerTest.java
+++ b/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerTest.java
@@ -39,16 +39,15 @@ public class ServerTest {
private static final String JSON_FULL = "{" + EOL + " \"server\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ " \"name\" : \"name\"," + EOL + " \"addresses\" : {" + EOL + " \"addresses-k1\" : [ {" + EOL
- + " \"version\" : \"version\"," + EOL + " \"addr\" : \"addr\"," + EOL
+ + " \"version\" : 4," + EOL + " \"addr\" : \"addr\"," + EOL
+ " \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL + " \"OS-EXT-IPS:type\" : \"type\""
- + EOL + " }, {" + EOL + " \"version\" : \"version\"," + EOL
- + " \"addr\" : \"addr\"," + EOL + " \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL
- + " \"OS-EXT-IPS:type\" : \"type\"" + EOL + " } ]," + EOL + " \"addresses-k2\" : [ {"
- + EOL + " \"version\" : \"version\"," + EOL + " \"addr\" : \"addr\"," + EOL
+ + EOL + " }, {" + EOL + " \"version\" : 4," + EOL + " \"addr\" : \"addr\"," + EOL
+ " \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL + " \"OS-EXT-IPS:type\" : \"type\""
- + EOL + " }, {" + EOL + " \"version\" : \"version\"," + EOL
+ + EOL + " } ]," + EOL + " \"addresses-k2\" : [ {" + EOL + " \"version\" : 4," + EOL
+ " \"addr\" : \"addr\"," + EOL + " \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL
- + " \"OS-EXT-IPS:type\" : \"type\"" + EOL + " } ]" + EOL + " }," + EOL
+ + " \"OS-EXT-IPS:type\" : \"type\"" + EOL + " }, {" + EOL + " \"version\" : 4,"
+ + EOL + " \"addr\" : \"addr\"," + EOL + " \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\","
+ + EOL + " \"OS-EXT-IPS:type\" : \"type\"" + EOL + " } ]" + EOL + " }," + EOL
+ " \"links\" : [ {" + EOL + " \"rel\" : \"rel\"," + EOL + " \"href\" : \"href\"," + EOL
+ " \"type\" : \"type\"" + EOL + " }, {" + EOL + " \"rel\" : \"rel\"," + EOL
+ " \"href\" : \"href\"," + EOL + " \"type\" : \"type\"" + EOL + " } ]," + EOL
@@ -155,7 +154,7 @@ public class ServerTest {
List<Address> address = addresses.get("addresses-k1");
Assert.assertEquals(2, address.size());
- Assert.assertEquals("version", address.get(0).getVersion());
+ Assert.assertEquals(4, address.get(0).getVersion());
Map<String, String> metadata = server.getMetadata();
Assert.assertNotNull(metadata);
diff --git a/nova-model/src/test/java/com/woorea/openstack/nova/model/ServersTest.java b/nova-model/src/test/java/com/woorea/openstack/nova/model/ServersTest.java
index 427f4f9..0cee90c 100644
--- a/nova-model/src/test/java/com/woorea/openstack/nova/model/ServersTest.java
+++ b/nova-model/src/test/java/com/woorea/openstack/nova/model/ServersTest.java
@@ -46,23 +46,23 @@ public class ServersTest {
sb.append(" \"name\" : \"name\"," + EOL);
sb.append(" \"addresses\" : {" + EOL);
sb.append(" \"addresses-k1\" : [ {" + EOL);
- sb.append(" \"version\" : \"version\"," + EOL);
+ sb.append(" \"version\" : 4," + EOL);
sb.append(" \"addr\" : \"addr\"," + EOL);
sb.append(" \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL);
sb.append(" \"OS-EXT-IPS:type\" : \"type\"" + EOL);
sb.append(" }, {" + EOL);
- sb.append(" \"version\" : \"version\"," + EOL);
+ sb.append(" \"version\" : 4," + EOL);
sb.append(" \"addr\" : \"addr\"," + EOL);
sb.append(" \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL);
sb.append(" \"OS-EXT-IPS:type\" : \"type\"" + EOL);
sb.append(" } ]," + EOL);
sb.append(" \"addresses-k2\" : [ {" + EOL);
- sb.append(" \"version\" : \"version\"," + EOL);
+ sb.append(" \"version\" : 4," + EOL);
sb.append(" \"addr\" : \"addr\"," + EOL);
sb.append(" \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL);
sb.append(" \"OS-EXT-IPS:type\" : \"type\"" + EOL);
sb.append(" }, {" + EOL);
- sb.append(" \"version\" : \"version\"," + EOL);
+ sb.append(" \"version\" : 4," + EOL);
sb.append(" \"addr\" : \"addr\"," + EOL);
sb.append(" \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL);
sb.append(" \"OS-EXT-IPS:type\" : \"type\"" + EOL);
@@ -265,23 +265,23 @@ public class ServersTest {
sb.append(" \"name\" : \"name\"," + EOL);
sb.append(" \"addresses\" : {" + EOL);
sb.append(" \"addresses-k1\" : [ {" + EOL);
- sb.append(" \"version\" : \"version\"," + EOL);
+ sb.append(" \"version\" : 4," + EOL);
sb.append(" \"addr\" : \"addr\"," + EOL);
sb.append(" \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL);
sb.append(" \"OS-EXT-IPS:type\" : \"type\"" + EOL);
sb.append(" }, {" + EOL);
- sb.append(" \"version\" : \"version\"," + EOL);
+ sb.append(" \"version\" : 4," + EOL);
sb.append(" \"addr\" : \"addr\"," + EOL);
sb.append(" \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL);
sb.append(" \"OS-EXT-IPS:type\" : \"type\"" + EOL);
sb.append(" } ]," + EOL);
sb.append(" \"addresses-k2\" : [ {" + EOL);
- sb.append(" \"version\" : \"version\"," + EOL);
+ sb.append(" \"version\" : 4," + EOL);
sb.append(" \"addr\" : \"addr\"," + EOL);
sb.append(" \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL);
sb.append(" \"OS-EXT-IPS:type\" : \"type\"" + EOL);
sb.append(" }, {" + EOL);
- sb.append(" \"version\" : \"version\"," + EOL);
+ sb.append(" \"version\" : 4," + EOL);
sb.append(" \"addr\" : \"addr\"," + EOL);
sb.append(" \"OS-EXT-IPS-MAC:mac_addr\" : \"macaddr\"," + EOL);
sb.append(" \"OS-EXT-IPS:type\" : \"type\"" + EOL);