@Test public void testAsDouble_shouldFailed() { thrown.expectAssertionError("Expecting:%n <apple>%nto be convertible to%n <double>"); String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<fruits>" + "<fruit name=\"apple\" weight=\"66.6\"/>" + "</fruits>"; assertThat(xml).valueByXPath(" }
public AbstractDoubleAssert<?> asDouble() { isNotNull(); double value = 0; try { value = Double.parseDouble(actual); } catch (NumberFormatException e) { throwAssertionError(shouldBeConvertible(actual, "double")); } return AssertionsAdapter.assertThat(value); }
ValueAssert extends AbstractCharSequenceAssert<ValueAssert, String> { public AbstractDoubleAssert<?> asDouble() { isNotNull(); double value = 0; try { value = Double.parseDouble(actual); } catch (NumberFormatException e) { throwAssertionError(shouldBeConvertible(actual, "double")); } return AssertionsAdapter.assertThat(value); } }
ValueAssert extends AbstractCharSequenceAssert<ValueAssert, String> { public AbstractDoubleAssert<?> asDouble() { isNotNull(); double value = 0; try { value = Double.parseDouble(actual); } catch (NumberFormatException e) { throwAssertionError(shouldBeConvertible(actual, "double")); } return AssertionsAdapter.assertThat(value); } private  ValueAssert(String value); }
ValueAssert extends AbstractCharSequenceAssert<ValueAssert, String> { public AbstractDoubleAssert<?> asDouble() { isNotNull(); double value = 0; try { value = Double.parseDouble(actual); } catch (NumberFormatException e) { throwAssertionError(shouldBeConvertible(actual, "double")); } return AssertionsAdapter.assertThat(value); } private  ValueAssert(String value); AbstractIntegerAssert<?> asInt(); AbstractDoubleAssert<?> asDouble(); AbstractBooleanAssert<?> asBoolean(); XmlAssert asXml(); XmlAssert asXml(String wrapNodeName); ValueAssert isEqualTo(int expected); ValueAssert isEqualTo(double expected); ValueAssert isEqualTo(boolean expected); @Override @CheckReturnValue // deal with binary incompatible change in AssertJ 3.15.0, see https://github.com/xmlunit/xmlunit/issues/181 ValueAssert describedAs(final String description, final Object... args); }
ValueAssert extends AbstractCharSequenceAssert<ValueAssert, String> { public AbstractDoubleAssert<?> asDouble() { isNotNull(); double value = 0; try { value = Double.parseDouble(actual); } catch (NumberFormatException e) { throwAssertionError(shouldBeConvertible(actual, "double")); } return AssertionsAdapter.assertThat(value); } private  ValueAssert(String value); AbstractIntegerAssert<?> asInt(); AbstractDoubleAssert<?> asDouble(); AbstractBooleanAssert<?> asBoolean(); XmlAssert asXml(); XmlAssert asXml(String wrapNodeName); ValueAssert isEqualTo(int expected); ValueAssert isEqualTo(double expected); ValueAssert isEqualTo(boolean expected); @Override @CheckReturnValue // deal with binary incompatible change in AssertJ 3.15.0, see https://github.com/xmlunit/xmlunit/issues/181 ValueAssert describedAs(final String description, final Object... args);  }