@Test public void testGetWithValidHint() throws ComponentLookupException { ComponentManager cm = this.mocker.getInstance(ComponentManager.class, "context"); HeightMeasurementHandler handler = new HeightMeasurementHandler(); when(cm.getInstance(MeasurementHandler.class, "height")).thenReturn(handler); Assert.assertEquals(handler, this.mocker.getComponentUnderTest().get("height")); }
public MeasurementHandler get(String measurementType) { try { return this.componentManager.get().getInstance(MeasurementHandler.class, measurementType); } catch (ComponentLookupException ex) { this.logger.warn("Requested unknown measurement type [{}]", measurementType); return null; } }
MeasurementsScriptService implements ScriptService { public MeasurementHandler get(String measurementType) { try { return this.componentManager.get().getInstance(MeasurementHandler.class, measurementType); } catch (ComponentLookupException ex) { this.logger.warn("Requested unknown measurement type [{}]", measurementType); return null; } } }
MeasurementsScriptService implements ScriptService { public MeasurementHandler get(String measurementType) { try { return this.componentManager.get().getInstance(MeasurementHandler.class, measurementType); } catch (ComponentLookupException ex) { this.logger.warn("Requested unknown measurement type [{}]", measurementType); return null; } }  }
MeasurementsScriptService implements ScriptService { public MeasurementHandler get(String measurementType) { try { return this.componentManager.get().getInstance(MeasurementHandler.class, measurementType); } catch (ComponentLookupException ex) { this.logger.warn("Requested unknown measurement type [{}]", measurementType); return null; } }  MeasurementHandler get(String measurementType); List<MeasurementHandler> getAvailableMeasurementHandlers(); Set<String> getAvailableMeasurementNames(); String getFuzzyValue(int percentile); String getFuzzyValue(double deviation); }
MeasurementsScriptService implements ScriptService { public MeasurementHandler get(String measurementType) { try { return this.componentManager.get().getInstance(MeasurementHandler.class, measurementType); } catch (ComponentLookupException ex) { this.logger.warn("Requested unknown measurement type [{}]", measurementType); return null; } }  MeasurementHandler get(String measurementType); List<MeasurementHandler> getAvailableMeasurementHandlers(); Set<String> getAvailableMeasurementNames(); String getFuzzyValue(int percentile); String getFuzzyValue(double deviation);  }