use of jetbrains.buildServer.server.rest.model.problem.scope.TestScopes in project teamcity-rest by JetBrains.
the class TestScopesRequest method serveGroupedTestOccurrences.
// Very highly experimental
@GET
@Path("/{scopeName}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(hidden = true, value = "highly experimental")
public TestScopes serveGroupedTestOccurrences(@QueryParam("locator") String locatorText, @PathParam("scopeName") String scopeName, @QueryParam("fields") String fields, @Context UriInfo uriInfo, @Context HttpServletRequest request) {
Set<String> supportedGroupings = new HashSet<>(Arrays.asList("package", "suite", "class"));
if (!supportedGroupings.contains(scopeName)) {
throw new BadRequestException("Invalid scope. Only scopes " + String.join(",", supportedGroupings) + " are supported.");
}
Locator patchedLocator = new Locator(locatorText);
patchedLocator.setDimension(TestScopesCollector.SCOPE_TYPE, scopeName);
PagedSearchResult<TestScope> items = myTestScopesCollector.getPagedItems(patchedLocator);
PagerData pager = new PagerData(uriInfo.getRequestUriBuilder(), request.getContextPath(), items, locatorText, "locator");
return new TestScopes(items.myEntries, new Fields(fields), pager, uriInfo, myBeanContext);
}
Aggregations