mirror of https://github.com/apache/cloudstack.git
parent
adec811052
commit
94fd03df13
|
|
@ -27,6 +27,7 @@ import junit.framework.Assert;
|
|||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.FieldNamingPolicy;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
|
@ -58,7 +59,8 @@ public class NeutronNetworkAdapterTest {
|
|||
entity = new StringRequestEntity(gsonNeutronNetwork.toJson(networkWrapper), "application/json", null);
|
||||
|
||||
String actual = entity.getContent();
|
||||
Assert.assertEquals(jsonString, actual);
|
||||
JsonParser parser = new JsonParser();
|
||||
Assert.assertEquals(parser.parse(jsonString), parser.parse(actual));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import org.apache.cloudstack.network.opendaylight.api.model.NeutronNodeWrapper;
|
|||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.FieldNamingPolicy;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
|
@ -48,7 +49,8 @@ public class NeutronNodeAdapterTest {
|
|||
entity = new StringRequestEntity(gsonNeutronNode.toJson(nodeWrapper), "application/json", null);
|
||||
|
||||
String actual = entity.getContent();
|
||||
Assert.assertEquals(jsonString, actual);
|
||||
JsonParser parser = new JsonParser();
|
||||
Assert.assertEquals(parser.parse(jsonString), parser.parse(actual));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import org.apache.cloudstack.network.opendaylight.api.model.NeutronPortWrapper;
|
|||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.FieldNamingPolicy;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
|
@ -61,7 +62,8 @@ public class NeutronPortAdapterTest {
|
|||
|
||||
String actual = entity.getContent();
|
||||
|
||||
Assert.assertEquals(jsonString, actual);
|
||||
JsonParser parser = new JsonParser();
|
||||
Assert.assertEquals(parser.parse(jsonString), parser.parse(actual));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue