@PUT
@Path("/topologies/{topologyId}/testcases/{testCaseId}/sources/{id}")
public Response addOrUpdateTestRunCaseSource(@PathParam("topologyId") Long topologyId,
@PathParam("testCaseId") Long testCaseId,
@PathParam("id") Long id,
TopologyTestRunCaseSource testRunCaseSource,
@Context SecurityContext securityContext) {
SecurityUtil.checkRoleOrPermissions(authorizer, securityContext, Roles.ROLE_TOPOLOGY_USER,
Topology.NAMESPACE, topologyId, WRITE);
testRunCaseSource.setId(id);
testRunCaseSource.setTestCaseId(testCaseId);
TopologySource topologySource = getAssociatedTopologySource(topologyId, testCaseId, testRunCaseSource.getSourceId());
testRunCaseSource.setVersionId(topologySource.getVersionId());
TopologyTestRunCaseSource updatedCase = catalogService.addOrUpdateTopologyTestRunCaseSource(testRunCaseSource.getId(), testRunCaseSource);
return WSUtils.respondEntity(updatedCase, OK);
}