@Test public void getScoreWithNoFeaturesDoesNothing() throws ComponentLookupException { String[] features = new String[] {}; String[] negativeFeatures = new String[] {}; PatientSpecificityService service = this.mocker.getInstance(PatientSpecificityService.class); CapturingMatcher<Patient> patientCapture = new CapturingMatcher<>(); when(service.getScore(Matchers.argThat(patientCapture))).thenReturn(0.0); Assert.assertEquals(0.0, this.mocker.getComponentUnderTest().getScore(features, negativeFeatures), 0.0); Patient patient = patientCapture.getLastValue(); Assert.assertTrue(patient.getFeatures().isEmpty()); Assert.assertNull(patient.getId()); Assert.assertNull(patient.getExternalId()); Assert.assertNull(patient.getDocumentReference()); Assert.assertNull(patient.getReporter()); Assert.assertNull(patient.getDisorders()); Assert.assertNull(patient.getData("")); Assert.assertNull(patient.getData(null)); Assert.assertNull(patient.toJSON()); Assert.assertNull(patient.toJSON(Collections.<String>emptySet())); Assert.assertNull(patient.toJSON(null)); patient.updateFromJSON(null); }
public double getScore(Patient patient) { return this.service.getScore(patient); }
PatientSpecificityScriptService implements ScriptService { public double getScore(Patient patient) { return this.service.getScore(patient); } }
PatientSpecificityScriptService implements ScriptService { public double getScore(Patient patient) { return this.service.getScore(patient); }  }
PatientSpecificityScriptService implements ScriptService { public double getScore(Patient patient) { return this.service.getScore(patient); }  double getScore(Patient patient); double getScore(String[] features, String[] negativeFeatures); }
PatientSpecificityScriptService implements ScriptService { public double getScore(Patient patient) { return this.service.getScore(patient); }  double getScore(Patient patient); double getScore(String[] features, String[] negativeFeatures);  }