@Test public void shouldThrowInformativeExceptionForDouble() { System.setProperty(TEST_PROPERTY, "not a number"); try { service.produceDoubleSystemProperty(mockInjectionPoint(NOT_SET, TEST_PROPERTY, NOT_SET)); } catch (RuntimeException re) { assertThat(re).hasMessage("System property '" + TEST_PROPERTY + "'='not a number' is not a valid Double"); } }
@Produces @SystemProperty public Double produceDoubleSystemProperty(InjectionPoint ip) { try { return Double.parseDouble(produceStringSystemProperty(ip)); } catch (NumberFormatException nfe) { throw parseException(ip, Double.class); } }
SystemPropertyProducer { @Produces @SystemProperty public Double produceDoubleSystemProperty(InjectionPoint ip) { try { return Double.parseDouble(produceStringSystemProperty(ip)); } catch (NumberFormatException nfe) { throw parseException(ip, Double.class); } } }
SystemPropertyProducer { @Produces @SystemProperty public Double produceDoubleSystemProperty(InjectionPoint ip) { try { return Double.parseDouble(produceStringSystemProperty(ip)); } catch (NumberFormatException nfe) { throw parseException(ip, Double.class); } }  }
SystemPropertyProducer { @Produces @SystemProperty public Double produceDoubleSystemProperty(InjectionPoint ip) { try { return Double.parseDouble(produceStringSystemProperty(ip)); } catch (NumberFormatException nfe) { throw parseException(ip, Double.class); } }  @Produces @SystemProperty String produceStringSystemProperty(InjectionPoint ip); @Produces @SystemProperty Boolean produceBooleanSystemProperty(InjectionPoint ip); @Produces @SystemProperty Integer produceIntegerSystemProperty(InjectionPoint ip); @Produces @SystemProperty Double produceDoubleSystemProperty(InjectionPoint ip); @Produces @SystemProperty BigDecimal produceBigDecimalSystemProperty(InjectionPoint ip); }
SystemPropertyProducer { @Produces @SystemProperty public Double produceDoubleSystemProperty(InjectionPoint ip) { try { return Double.parseDouble(produceStringSystemProperty(ip)); } catch (NumberFormatException nfe) { throw parseException(ip, Double.class); } }  @Produces @SystemProperty String produceStringSystemProperty(InjectionPoint ip); @Produces @SystemProperty Boolean produceBooleanSystemProperty(InjectionPoint ip); @Produces @SystemProperty Integer produceIntegerSystemProperty(InjectionPoint ip); @Produces @SystemProperty Double produceDoubleSystemProperty(InjectionPoint ip); @Produces @SystemProperty BigDecimal produceBigDecimalSystemProperty(InjectionPoint ip);  }