@Test public void testCreateDefectInRelease() { handler.addRequest("POST", "/qcbin/rest/domains/domain/projects/project/apmuiservices/additemservice/createdefectinrelease", 200) .expectBody("description=something&detectedBy=me&detectedOn=&featureID=1439&name=somewhat&releaseId=1001&sevirity=2-High&sprintID=1001&teamID=101&productGroupId=1200") .content("apmUIServiceTest_defect.xml"); RestInvocations.loadMetadata(handler, "project-task"); handler.addRequest("GET", "/qcbin/rest/domains/domain/projects/project/project-tasks?fields=&query={release-backlog-item-id[4289]}&order-by={}", 200) .content("apmUIServiceTest_task.xml"); final LinkedList<EntityCheck> list = new LinkedList<EntityCheck>(); list.add(new EntityCheck() { @Override public void run() { Assert.assertEquals("release-backlog-item", entity.getType()); Assert.assertEquals(4289, entity.getId()); Assert.assertEquals(EntityListener.Event.CREATE, event); } }); list.add(new EntityCheck() { @Override public void run() { Assert.assertEquals("defect", entity.getType()); Assert.assertEquals(86, entity.getId()); Assert.assertEquals(EntityListener.Event.CREATE, event); Assert.assertEquals("4289", entity.getPropertyValue("release-backlog-item.id")); } }); list.add(new EntityCheck() { @Override public void run() { Assert.assertEquals("project-task", entity.getType()); Assert.assertEquals(107, entity.getId()); Assert.assertEquals(EntityListener.Event.CREATE, event); } }); addEntityListener(new EntityAdapter() { @Override public void entityLoaded(Entity entity, Event event) { handler.done(list.removeFirst().set(entity, event)); } }); handler.async(3); apmUIService.createDefectInRelease("something", "somewhat", "2-High", "me", 1001, 1001, 101, 1439, 1200); }
public Entity createDefectInRelease(String description, String summary, String severity, String detectedBy, int releaseId, int sprintId, int teamId, int featureId, int workspaceId) { StringBuffer buf = new StringBuffer(); buf.append("description=").append(EntityQuery.encode(description)); buf.append("&detectedBy=").append(EntityQuery.encode(detectedBy)); buf.append("&detectedOn="); buf.append("&featureID=").append(featureId > 0? featureId: 0); buf.append("&name=").append(EntityQuery.encode(summary)); buf.append("&releaseId=").append(releaseId); buf.append("&sevirity=").append(EntityQuery.encode(severity)); buf.append("&sprintID=").append(sprintId); buf.append("&teamID=").append(teamId); buf.append("&productGroupId=").append(workspaceId); return createItem("apmuiservices/additemservice/createdefectinrelease", buf.toString()); }
ApmUIService { public Entity createDefectInRelease(String description, String summary, String severity, String detectedBy, int releaseId, int sprintId, int teamId, int featureId, int workspaceId) { StringBuffer buf = new StringBuffer(); buf.append("description=").append(EntityQuery.encode(description)); buf.append("&detectedBy=").append(EntityQuery.encode(detectedBy)); buf.append("&detectedOn="); buf.append("&featureID=").append(featureId > 0? featureId: 0); buf.append("&name=").append(EntityQuery.encode(summary)); buf.append("&releaseId=").append(releaseId); buf.append("&sevirity=").append(EntityQuery.encode(severity)); buf.append("&sprintID=").append(sprintId); buf.append("&teamID=").append(teamId); buf.append("&productGroupId=").append(workspaceId); return createItem("apmuiservices/additemservice/createdefectinrelease", buf.toString()); } }
ApmUIService { public Entity createDefectInRelease(String description, String summary, String severity, String detectedBy, int releaseId, int sprintId, int teamId, int featureId, int workspaceId) { StringBuffer buf = new StringBuffer(); buf.append("description=").append(EntityQuery.encode(description)); buf.append("&detectedBy=").append(EntityQuery.encode(detectedBy)); buf.append("&detectedOn="); buf.append("&featureID=").append(featureId > 0? featureId: 0); buf.append("&name=").append(EntityQuery.encode(summary)); buf.append("&releaseId=").append(releaseId); buf.append("&sevirity=").append(EntityQuery.encode(severity)); buf.append("&sprintID=").append(sprintId); buf.append("&teamID=").append(teamId); buf.append("&productGroupId=").append(workspaceId); return createItem("apmuiservices/additemservice/createdefectinrelease", buf.toString()); } ApmUIService(RestService restService, EntityService entityService, ErrorService errorService); }
ApmUIService { public Entity createDefectInRelease(String description, String summary, String severity, String detectedBy, int releaseId, int sprintId, int teamId, int featureId, int workspaceId) { StringBuffer buf = new StringBuffer(); buf.append("description=").append(EntityQuery.encode(description)); buf.append("&detectedBy=").append(EntityQuery.encode(detectedBy)); buf.append("&detectedOn="); buf.append("&featureID=").append(featureId > 0? featureId: 0); buf.append("&name=").append(EntityQuery.encode(summary)); buf.append("&releaseId=").append(releaseId); buf.append("&sevirity=").append(EntityQuery.encode(severity)); buf.append("&sprintID=").append(sprintId); buf.append("&teamID=").append(teamId); buf.append("&productGroupId=").append(workspaceId); return createItem("apmuiservices/additemservice/createdefectinrelease", buf.toString()); } ApmUIService(RestService restService, EntityService entityService, ErrorService errorService); Entity createDefectInRelease(String description, String summary, String severity, String detectedBy,
                                        int releaseId, int sprintId, int teamId, int featureId, int workspaceId); Entity createRequirementInRelease(String description, String name, String priority, int storyPoints,
                                             int releaseId, int sprintId, int teamId, int featureId, int workspaceId); AuthenticationInfo getAuthenticationInfo(); }
ApmUIService { public Entity createDefectInRelease(String description, String summary, String severity, String detectedBy, int releaseId, int sprintId, int teamId, int featureId, int workspaceId) { StringBuffer buf = new StringBuffer(); buf.append("description=").append(EntityQuery.encode(description)); buf.append("&detectedBy=").append(EntityQuery.encode(detectedBy)); buf.append("&detectedOn="); buf.append("&featureID=").append(featureId > 0? featureId: 0); buf.append("&name=").append(EntityQuery.encode(summary)); buf.append("&releaseId=").append(releaseId); buf.append("&sevirity=").append(EntityQuery.encode(severity)); buf.append("&sprintID=").append(sprintId); buf.append("&teamID=").append(teamId); buf.append("&productGroupId=").append(workspaceId); return createItem("apmuiservices/additemservice/createdefectinrelease", buf.toString()); } ApmUIService(RestService restService, EntityService entityService, ErrorService errorService); Entity createDefectInRelease(String description, String summary, String severity, String detectedBy,
                                        int releaseId, int sprintId, int teamId, int featureId, int workspaceId); Entity createRequirementInRelease(String description, String name, String priority, int storyPoints,
                                             int releaseId, int sprintId, int teamId, int featureId, int workspaceId); AuthenticationInfo getAuthenticationInfo();  }