All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testobject.appium.common.data.SuiteReport Maven / Gradle / Ivy

There is a newer version: 0.2.7
Show newest version
package org.testobject.appium.common.data;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;

import java.util.Set;

public class SuiteReport {

	public static class Id extends org.testobject.appium.common.data.Id {
		public Id(Long value) {
			super(value);
		}
	}

	private final Id id;
	private final Set testReports;

	@JsonCreator
	public SuiteReport(@JsonProperty("id") Id id, @JsonProperty("testReports") Set testReports) {
		this.id = id;
		this.testReports = testReports;
	}

	public Id getId() {
		return id;
	}

	public Optional getTestReportId(Test test) {
		for (TestReport testReport : testReports) {
			if (testReport.getTest().equals(test)) {
				return Optional.of(testReport.getId());
			}
		}

		return Optional.absent();
	}

	public Optional getTestDeviceId(Test test) {
		for (TestReport testReport : testReports) {
			if (testReport.getTest().equals(test)) {
				return Optional.of(testReport.getTest().getDeviceId());
			}
		}

		return Optional.absent();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy