mirror of https://github.com/apache/jclouds.git
updated to latest parsing format
This commit is contained in:
parent
b909137c4a
commit
95708f36ea
|
@ -28,11 +28,9 @@ import javax.ws.rs.core.MediaType;
|
|||
|
||||
import org.jclouds.glesys.domain.Server;
|
||||
import org.jclouds.glesys.domain.ServerDetails;
|
||||
import org.jclouds.glesys.functions.MergeArgumentsAndReturnServerDetails;
|
||||
import org.jclouds.http.filters.BasicAuthentication;
|
||||
import org.jclouds.rest.annotations.ExceptionParser;
|
||||
import org.jclouds.rest.annotations.RequestFilters;
|
||||
import org.jclouds.rest.annotations.ResponseParser;
|
||||
import org.jclouds.rest.annotations.SelectJson;
|
||||
import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
|
||||
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
|
||||
|
@ -65,7 +63,7 @@ public interface ServerAsyncClient {
|
|||
*/
|
||||
@GET
|
||||
@Path("/server/details/serverid/{id}/format/json")
|
||||
@ResponseParser(MergeArgumentsAndReturnServerDetails.class)
|
||||
@SelectJson("server")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<ServerDetails> getServerDetails(@PathParam("id") String id);
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.jclouds.glesys.features;
|
|||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.jclouds.glesys.functions.MergeArgumentsAndReturnServerDetails;
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.functions.ParseFirstJsonValueNamed;
|
||||
import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
|
||||
|
@ -64,7 +63,7 @@ public class ServerAsyncClientTest extends BaseGleSYSAsyncClientTest<ServerAsync
|
|||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
assertPayloadEquals(httpRequest, null, null, false);
|
||||
|
||||
assertResponseParserClassEquals(method, httpRequest, MergeArgumentsAndReturnServerDetails.class);
|
||||
assertResponseParserClassEquals(method, httpRequest, ParseFirstJsonValueNamed.class);
|
||||
assertSaxResponseParserClassEquals(method, null);
|
||||
assertExceptionParserClassEquals(method, ReturnNullOnNotFoundOr404.class);
|
||||
|
||||
|
|
|
@ -25,10 +25,9 @@ import javax.ws.rs.core.MediaType;
|
|||
|
||||
import org.jclouds.glesys.config.GleSYSParserModule;
|
||||
import org.jclouds.glesys.domain.ServerDetails;
|
||||
import org.jclouds.glesys.functions.MergeArgumentsAndReturnServerDetails;
|
||||
import org.jclouds.json.BaseItemParserTest;
|
||||
import org.jclouds.json.config.GsonModule;
|
||||
import org.jclouds.rest.annotations.ResponseParser;
|
||||
import org.jclouds.rest.annotations.SelectJson;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
|
@ -47,7 +46,7 @@ public class ParseServerDetailsWithoutIPsTest extends BaseItemParserTest<ServerD
|
|||
}
|
||||
|
||||
@Override
|
||||
@ResponseParser(MergeArgumentsAndReturnServerDetails.class)
|
||||
@SelectJson("server")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public ServerDetails expected() {
|
||||
return ServerDetails.builder().id("vz1541880").hostname("mammamia").datacenter("Falkenberg").platform("OpenVZ")
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"response":{"status":{"code":"200","text":"OK"},"server":{"hostname":"mammamia","description":"description","cpucores":"1","memory":"128","disk":"5","transfer":"50","template":"Ubuntu 11.04 64-bit","datacenter":"Falkenberg","managedhosting":"no","platform":"OpenVZ","cost":{"amount":6.38,"currency":"EUR","timeperiod":"month"},"iplist":[]},"arguments":{"serverid":"vz1541880"}}}
|
||||
{"response":{"status":{"code":"200","text":"OK"},"server":{"serverid":"vz1541880","hostname":"mammamia","description":"description","cpucores":"1","memory":"128","disk":"5","transfer":"50","template":"Ubuntu 11.04 64-bit","datacenter":"Falkenberg","managedhosting":"no","platform":"OpenVZ","cost":{"amount":6.38,"currency":"EUR","timeperiod":"month"},"iplist":[]},"debug":{"serverid":"vz1541880"}}}
|
||||
|
|
Loading…
Reference in New Issue