@Override public String create(TestDataCreateRequest request) throws HygieiaException { /** * Step 1: create Collector if not there Step 2: create Collector item if not there Step 3: * Insert test data if new. If existing, update it */ Collector collector = createCollector(); if (collector == null) { throw new HygieiaException( "Failed creating Test collector.", HygieiaException.COLLECTOR_CREATE_ERROR); } CollectorItem collectorItem = createCollectorItem(collector, request); if (collectorItem == null) { throw new HygieiaException( "Failed creating Test collector item.", HygieiaException.COLLECTOR_ITEM_CREATE_ERROR); } TestResult testResult = createTest(collectorItem, request); if (testResult == null) { throw new HygieiaException( "Failed inserting/updating Test information.", HygieiaException.ERROR_INSERTING_DATA); } return testResult.getId().toString(); }