MultipleBuildsFeatureMergeHelper { public MergeFeature getMergeFeature(final String featureId) { if (!this.orderedBuildList.isEmpty() && this.features.containsKey(featureId, getLatestBuild())) { final Feature feature = this.features.get(featureId, getLatestBuild()); final List<String> featureStatuses = getFeatureStatuses(feature); final List<MergeScenario> scenarioList = getMergedScenarios(feature); final MergeFeature mergeFeature = new MergeFeature(); mergeFeature.setId(feature.getId()); mergeFeature.setName(feature.getName()); mergeFeature.setStatuses(featureStatuses); mergeFeature.setUrl("reports/" + feature.getCoordinates().getProduct() + "/" + feature.getCoordinates().getVersionString() + "/{{BUILD_NAME}}/" + feature.getId()); mergeFeature.setScenarios(scenarioList); return mergeFeature; } else { return null; } } MultipleBuildsFeatureMergeHelper(final List<String> orderedBuilds); void addFeature(final Feature feature); MergeFeature getMergeFeature(final String featureId);  }
@Test public void noFeatureAdded() { final Feature feature = new Feature(BasicDBObject .parse("{'_id' : 'p1/f1','id' : 'f1','description' : '' ,'name' : 'f1', 'elements' : [{'id' : 'e1','description' : '','name' : 'e1','steps' : [{'result' : {'status' : 'passed'},'name' : 'e2',},{'result' : {'status' : 'passed'},'name' : 'e3',}],}],'coordinates' : {'product' : 'P1','major' : 1,'minor' : 1,'servicePack' : 1,'build' : 'build1','version' : '1.1.1'},'calculatedStatus' : 'unknown status? - expected passed,failed or undefined','originalAutomatedStatus' : 'unknown status? - expected passed,failed or undefined'}")); final String[] builds = { "build1", "build2" }; final MultipleBuildsFeatureMergeHelper target = new MultipleBuildsFeatureMergeHelper(Arrays.asList(builds)); assertNull(target.getMergeFeature(feature.getId())); }