use of com.emc.vipr.model.sys.TargetVersionResponse in project coprhd-controller by CoprHD.
the class UpgradeService method getTargetVersion.
/**
* Show the current target version
*
* @brief Show the target version
* @prereq none
* @return Target version response
*/
@GET
@Path("target-version/")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public TargetVersionResponse getTargetVersion() {
SoftwareVersion version = null;
try {
version = _coordinator.getTargetInfo(RepositoryInfo.class).getCurrentVersion();
} catch (Exception e) {
throw APIException.internalServerErrors.getObjectFromError("current version", "coordinator", e);
}
TargetVersionResponse resp = new TargetVersionResponse();
resp.setTargetVersion(version.toString());
return resp;
}
use of com.emc.vipr.model.sys.TargetVersionResponse in project coprhd-controller by CoprHD.
the class DisasterRecoveryServiceTest method mockViPRSystemClient.
protected ViPRSystemClient mockViPRSystemClient(final String version) {
class MockViPRSystemClient extends ViPRSystemClient {
// .upgrade().getTargetVersion().getTargetVersion()
@Override
public com.emc.vipr.client.system.Upgrade upgrade() {
com.emc.vipr.client.system.Upgrade upgrade = mock(com.emc.vipr.client.system.Upgrade.class);
TargetVersionResponse targetVersionResponse = new TargetVersionResponse(version);
doReturn(targetVersionResponse).when(upgrade).getTargetVersion();
return upgrade;
}
}
return new MockViPRSystemClient();
}
Aggregations