tvarchive / optimusTemplate

This is a cucumber jvm implementation template using the optimus mobile automation framework. If you like it, star it, help spread the word.

Home Page:http://docs.testvagrant.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot parse content to class com.testvagrant.monitor.requests.Device because no content-type was present in the response and no default parser has been set.

asitishere opened this issue · comments

commented

09:10:35 -------- All devices and there status --------
09:10:35 4S99LV4SO7KNWKRG --- Engaged
09:10:35 Matching Device is Device{platform:"ANDROID", deviceName:"null", runsOn:"DEVICE", platformVersion:"null", udid:"4S99LV4SO7KNWKRG"}
09:10:35 �[31mjava.lang.IllegalStateException: Cannot parse content to class com.testvagrant.monitor.requests.Device because no content-type was present in the response and no default parser has been set.
09:10:35 You can specify a default parser using e.g.:
09:10:35 RestAssured.defaultParser = Parser.JSON;
09:10:35
09:10:35 or you can specify an explicit ObjectMapper using as(class com.testvagrant.monitor.requests.Device, );
09:10:35 at sun.reflect.GeneratedConstructorAccessor80.newInstance(Unknown Source)
09:10:35 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
09:10:35 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
09:10:35 at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
09:10:35 at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
09:10:35 at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
09:10:35 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
09:10:35 at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl$_as_closure3.doCall(RestAssuredResponseOptionsGroovyImpl.groovy:219)
09:10:35 at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl$_as_closure3.doCall(RestAssuredResponseOptionsGroovyImpl.groovy)
09:10:35 at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown Source)
09:10:35 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:10:35 at java.lang.reflect.Method.invoke(Method.java:498)
09:10:35 at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
09:10:35 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
09:10:35 at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
09:10:35 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
09:10:35 at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
09:10:35 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
09:10:35 at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl.findContentType(RestAssuredResponseOptionsGroovyImpl.groovy:482)
09:10:35 at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source)
09:10:35 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:10:35 at java.lang.reflect.Method.invoke(Method.java:498)
09:10:35 at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
09:10:35 at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
09:10:35 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
09:10:35 at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl.as(RestAssuredResponseOptionsGroovyImpl.groovy:218)
09:10:35 at io.restassured.internal.RestAssuredResponseOptionsImpl.as(RestAssuredResponseOptionsImpl.java:164)
09:10:35 at com.testvagrant.monitor.clients.DevicesClient.getDevice(DevicesClient.java:50)
09:10:35 at com.testvagrant.monitor.services.DevicesServiceImpl.updateFirstAvailableDeviceToEngaged(DevicesServiceImpl.java:38)
09:10:35 at com.testvagrant.optimus.device.DeviceFinder.getAvailableDeviceAndUpdateToEngaged(DeviceFinder.java:56)
09:10:35 at com.testvagrant.optimus.parser.OptimusConfigParser.allocateDevicesForCurrentScenario(OptimusConfigParser.java:151)
09:10:35 at com.testvagrant.optimus.device.OptimusController.registerSmartBOTs(OptimusController.java:152)
09:10:35 at steps.StartingSteps.setUp(StartingSteps.java:26)
09:10:35 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:10:35 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:10:35 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:10:35 at java.lang.reflect.Method.invoke(Method.java:498)
09:10:35 at cucumber.runtime.Utils$1.call(Utils.java:32)
09:10:35 at cucumber.runtime.Timeout.timeout(Timeout.java:16)
09:10:35 at cucumber.runtime.Utils.invoke(Utils.java:26)
09:10:35 at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60)
09:10:35 at cucumber.runtime.HookDefinitionMatch.runStep(HookDefinitionMatch.java:17)
09:10:35 at cucumber.runner.UnskipableStep.executeStep(UnskipableStep.java:22)
09:10:35 at cucumber.api.TestStep.run(TestStep.java:83)
09:10:35 at cucumber.api.TestCase.run(TestCase.java:58)
09:10:35 at cucumber.runner.Runner.runPickle(Runner.java:80)
09:10:35 at cucumber.runtime.Runtime.runFeature(Runtime.java:119)
09:10:35 at cucumber.runtime.Runtime.run(Runtime.java:104)
09:10:35 at cucumber.api.cli.Main.run(Main.java:36)
09:10:35 at cucumber.api.cli.Main.main(Main.java:18)

commented

@KrishnB @sukesh15 Please have a look.

commented

java.lang.IllegalStateException: Cannot parse content to class com.testvagrant.monitor.requests.Device because no content-type was present in the response and no default parser has been set.
You can specify a default parser using e.g.:
RestAssured.defaultParser = Parser.JSON;

commented

with 3.0 the issue is not preset.