use of jetbrains.buildServer.serverSide.impl.problems.BuildProblemInfoImpl in project teamcity-rest by JetBrains.
the class InvestigationFinderTest method testProblemInvestigationModel.
@Test
public void testProblemInvestigationModel() throws Exception {
createFailingBuild();
final BuildProblemInfoImpl buildProblem = new BuildProblemInfoImpl(myProject.getProjectId(), getProblemId(PROBLEM_IDENTITY));
myFixture.getResponsibilityFacadeEx().setBuildProblemResponsibility(buildProblem, myProject.getProjectId(), createRespEntry(ResponsibilityEntry.State.TAKEN, myUser));
final BuildProblemResponsibilityEntry buildProblemResponsibility = myFixture.getResponsibilityFacadeEx().findBuildProblemResponsibility(buildProblem, myProject.getProjectId());
assert buildProblemResponsibility != null;
final PagedSearchResult<InvestigationWrapper> ivestigationWrappers = myInvestigationFinder.getItems((String) null);
final Investigations investigations = new Investigations(ivestigationWrappers.myEntries, null, Fields.LONG, getBeanContext(myServer));
assertEquals(1, investigations.count.longValue());
final Investigation investigation = investigations.items.get(0);
assertEquals("assignmentProject:(id:" + myProject.getExternalId() + "),problem:(id:" + buildProblemResponsibility.getBuildProblemInfo().getId() + ")", investigation.id);
assertEquals("TAKEN", investigation.state);
assertEquals((Long) myUser.getId(), investigation.assignee.getId());
assertEquals("The comment", investigation.assignment.text);
assertEquals(null, investigation.target.anyProblem);
assertEquals(null, investigation.target.tests);
assertEquals(PROBLEM_IDENTITY, investigation.target.problems.items.get(0).identity);
assertEquals(myProject.getExternalId(), investigation.scope.project.id);
}
Aggregations