@RequestMapping(value = "/{testId}/testpackage", method = RequestMethod.GET) public TestArtifact tcTestPackage( @RequestParam("type") String type, @PathVariable final Long testId) { logger.info("Fetching testDataSpecification of testcase/teststep with id=" + testId); if ("TestCase".equalsIgnoreCase(type)) { return testCaseRepository.testPackage(testId); } else if ("TestStep".equalsIgnoreCase(type)) { return testStepRepository.testPackage(testId); } return null; }
@RequestMapping(value = "/{testId}/messagecontent", method = RequestMethod.GET) public TestArtifact tcMessageContent( @RequestParam("type") String type, @PathVariable final Long testId) { logger.info("Fetching messagecontent of testcase/teststep with id=" + testId); if ("TestCase".equalsIgnoreCase(type)) { return testCaseRepository.messageContent(testId); } else if ("TestStep".equalsIgnoreCase(type)) { return testStepRepository.messageContent(testId); } return null; }
@RequestMapping(value = "/{testId}", method = RequestMethod.GET) public Map<String, TestArtifact> allArtifacts( @RequestParam("type") String type, @PathVariable final Long testId) { AbstractTestCase obj = null; Map<String, TestArtifact> result = new HashMap<String, TestArtifact>(); logger.info("Fetching artifacts of " + type + " with id=" + testId); if ("TestCase".equalsIgnoreCase(type)) { obj = testCaseRepository.findOne(testId); } else if ("TestStep".equalsIgnoreCase(type)) { obj = testStepRepository.findOne(testId); } if (obj != null) { result.put("jurorDocument", obj.getJurorDocument()); result.put("messageContent", obj.getMessageContent()); result.put("testDataSpecification", obj.getTestDataSpecification()); result.put("testStory", obj.getTestStory()); result.put("testPackage", obj.getTestPackage()); } return result; }