org.testobject.rest.api.resource.v2.AppiumSuiteResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testobject-java-api Show documentation
Show all versions of testobject-java-api Show documentation
java wrapper for testobject's java apis
package org.testobject.rest.api.resource.v2;
import com.fasterxml.jackson.core.type.TypeReference;
import org.testobject.rest.api.RestClient;
import org.testobject.rest.api.appium.common.data.DataCenterSuite;
import org.testobject.rest.api.appium.common.data.Suite;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.GenericType;
import java.util.Set;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON_TYPE;
public class AppiumSuiteResource {
private final RestClient client;
public AppiumSuiteResource(RestClient client) {
this.client = client;
}
/**
* Returns the IDs of the devices which you had selected for the specified suite
*/
public Set readDeviceDescriptorIds(long suiteId) {
return client
.path("v2")
.path("appium")
.path("suites").path(Long.toString(suiteId))
.path("deviceIds")
.request(APPLICATION_JSON_TYPE)
.get(new GenericType<>(new TypeReference>() {
}.getType()));
}
/**
* Updates the properties of a suite
*/
public Suite updateSuite(long suiteId, Suite suite) {
return client
.path("v2")
.path("appium")
.path("suites").path(Long.toString(suiteId))
.request(APPLICATION_JSON_TYPE)
.put(Entity.json(suite), Suite.class);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy