Don't try to cheat the parser - real life has the payload inside an AsyncJob, so test that

This commit is contained in:
Richard Downer 2011-12-01 17:07:44 +02:00
parent 1b0b154dfc
commit acf19637da
2 changed files with 8 additions and 5 deletions

View File

@ -18,6 +18,7 @@
*/ */
package org.jclouds.cloudstack.parse; package org.jclouds.cloudstack.parse;
import org.jclouds.cloudstack.domain.AsyncJob;
import org.jclouds.cloudstack.domain.OperationResult; import org.jclouds.cloudstack.domain.OperationResult;
import org.jclouds.json.BaseItemParserTest; import org.jclouds.json.BaseItemParserTest;
import org.jclouds.rest.annotations.SelectJson; import org.jclouds.rest.annotations.SelectJson;
@ -28,7 +29,7 @@ import org.testng.annotations.Test;
* @author Richard Downer * @author Richard Downer
*/ */
@Test(groups = "unit", testName = "DeleteNetworkResponseTest") @Test(groups = "unit", testName = "DeleteNetworkResponseTest")
public class OperationResultResponseTest extends BaseItemParserTest<OperationResult> { public class OperationResultResponseTest extends BaseItemParserTest<AsyncJob> {
@Override @Override
public String resource() { public String resource() {
@ -36,9 +37,11 @@ public class OperationResultResponseTest extends BaseItemParserTest<OperationRes
} }
@Override @Override
@SelectJson("jobresult") @SelectJson("queryasyncjobresultresponse")
public OperationResult expected() { public AsyncJob expected() {
return new OperationResult(true, null); OperationResult payload = new OperationResult(true, null);
AsyncJob<OperationResult> wrapper = AsyncJob.<OperationResult>builder().id(118).status(1).progress(0).resultCode(0).resultType("object").result(payload).build();
return wrapper;
} }
} }

View File

@ -1 +1 @@
{ "jobresult":{"success":true} } { "queryasyncjobresultresponse" : {"jobid":118,"jobstatus":1,"jobprocstatus":0,"jobresultcode":0,"jobresulttype":"object","jobresult":{"success":true}} }