summaryrefslogtreecommitdiffstats
path: root/nova-model/src
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-04-08 16:19:28 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-08 16:19:28 +0000
commitd379bffefe7acf79d4aff05967cb754e61619eac (patch)
tree7930b4ec797eb6334fb0f64b29d5aca18a22eabf /nova-model/src
parent6bb115f3212190d798691261530ec1d95e5d4a8e (diff)
parent441ba467f510a6c58f2012f96305dbeef0eb535b (diff)
Merge "power level should not be a string"
Diffstat (limited to 'nova-model/src')
-rw-r--r--nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java4
-rw-r--r--nova-model/src/test/java/com/woorea/openstack/nova/model/ServerTest.java9
-rw-r--r--nova-model/src/test/java/com/woorea/openstack/nova/model/ServersTest.java4
3 files changed, 8 insertions, 9 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 90b2fe2..672a630 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
@@ -204,7 +204,7 @@ public class Server implements Serializable {
private String taskState;
@JsonProperty("OS-EXT-STS:power_state")
- private String powerState;
+ private int powerState;
@JsonProperty("OS-EXT-STS:vm_state")
private String vmState;
@@ -407,7 +407,7 @@ public class Server implements Serializable {
/**
* @return the powerState
*/
- public String getPowerState() {
+ public int getPowerState() {
return powerState;
}
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 87789ff..ecbd526 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
@@ -117,9 +117,8 @@ public class ServerTest {
+ " \"href\" : \"href\"," + EOL + " \"type\" : \"type\"" + EOL + " }, {" + EOL
+ " \"rel\" : \"rel\"," + EOL + " \"href\" : \"href\"," + EOL + " \"type\" : \"type\""
+ EOL + " } ]," + EOL + " \"tenant_id\" : \"tenantid\"" + EOL + " } ]," + EOL
- + " \"OS-EXT-STS:task_state\" : \"taskstate\"," + EOL
- + " \"OS-EXT-STS:power_state\" : \"powerstate\"," + EOL + " \"OS-EXT-STS:vm_state\" : \"vmstate\","
- + EOL + " \"OS-EXT-SRV-ATTR:host\" : \"host\"," + EOL
+ + " \"OS-EXT-STS:task_state\" : \"taskstate\"," + EOL + " \"OS-EXT-STS:power_state\" : 1," + EOL
+ + " \"OS-EXT-STS:vm_state\" : \"vmstate\"," + EOL + " \"OS-EXT-SRV-ATTR:host\" : \"host\"," + EOL
+ " \"OS-EXT-SRV-ATTR:instance_name\" : \"instancename\"," + EOL
+ " \"OS-EXT-SRV-ATTR:hypervisor_hostname\" : \"hypervisorhostname\"," + EOL
+ " \"OS-DCF:diskConfig\" : \"diskconfig\"," + EOL
@@ -172,8 +171,8 @@ public class ServerTest {
String taskState = server.getTaskState();
Assert.assertNotNull(taskState);
- String powerState = server.getPowerState();
- Assert.assertNotNull(powerState);
+ int powerState = server.getPowerState();
+ Assert.assertEquals(1, powerState);
String vmState = server.getVmState();
Assert.assertNotNull(vmState);
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 0cee90c..5be1aab 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
@@ -248,7 +248,7 @@ public class ServersTest {
sb.append(" \"tenant_id\" : \"tenantid\"" + EOL);
sb.append(" } ]," + EOL);
sb.append(" \"OS-EXT-STS:task_state\" : \"taskstate\"," + EOL);
- sb.append(" \"OS-EXT-STS:power_state\" : \"powerstate\"," + EOL);
+ sb.append(" \"OS-EXT-STS:power_state\" : 1," + EOL);
sb.append(" \"OS-EXT-STS:vm_state\" : \"vmstate\"," + EOL);
sb.append(" \"OS-EXT-SRV-ATTR:host\" : \"host\"," + EOL);
sb.append(" \"OS-EXT-SRV-ATTR:instance_name\" : \"instancename\"," + EOL);
@@ -467,7 +467,7 @@ public class ServersTest {
sb.append(" \"tenant_id\" : \"tenantid\"" + EOL);
sb.append(" } ]," + EOL);
sb.append(" \"OS-EXT-STS:task_state\" : \"taskstate\"," + EOL);
- sb.append(" \"OS-EXT-STS:power_state\" : \"powerstate\"," + EOL);
+ sb.append(" \"OS-EXT-STS:power_state\" : 1," + EOL);
sb.append(" \"OS-EXT-STS:vm_state\" : \"vmstate\"," + EOL);
sb.append(" \"OS-EXT-SRV-ATTR:host\" : \"host\"," + EOL);
sb.append(" \"OS-EXT-SRV-ATTR:instance_name\" : \"instancename\"," + EOL);