@Test public void testToString() { String[] expectedParts = {"float=4.5", "boolean=true", "double=3.3", "intWithNoDefault=11", "list=[a, b, c]", "set=[d, e, f]", "int=1", "long=2"}; String actual = configuration.toString(); for (String part : expectedParts) { assertThat(actual).contains(part); } }
@Override public String toString() { StringBuilder builder = new StringBuilder(apiInterface.getSimpleName()).append('{'); methodWrappers.forEach((method, handler) -> { if (handler instanceof PropertyMethodHandler) { builder.append(handler).append(", "); } }); builder.setLength(builder.length() - 2); builder.append('}'); return builder.toString(); }
SpringProxyInvocationHandler implements InvocationHandler { @Override public String toString() { StringBuilder builder = new StringBuilder(apiInterface.getSimpleName()).append('{'); methodWrappers.forEach((method, handler) -> { if (handler instanceof PropertyMethodHandler) { builder.append(handler).append(", "); } }); builder.setLength(builder.length() - 2); builder.append('}'); return builder.toString(); } }
SpringProxyInvocationHandler implements InvocationHandler { @Override public String toString() { StringBuilder builder = new StringBuilder(apiInterface.getSimpleName()).append('{'); methodWrappers.forEach((method, handler) -> { if (handler instanceof PropertyMethodHandler) { builder.append(handler).append(", "); } }); builder.setLength(builder.length() - 2); builder.append('}'); return builder.toString(); } SpringProxyInvocationHandler(Class<?> apiInterface, String prefix, Environment environment); }
SpringProxyInvocationHandler implements InvocationHandler { @Override public String toString() { StringBuilder builder = new StringBuilder(apiInterface.getSimpleName()).append('{'); methodWrappers.forEach((method, handler) -> { if (handler instanceof PropertyMethodHandler) { builder.append(handler).append(", "); } }); builder.setLength(builder.length() - 2); builder.append('}'); return builder.toString(); } SpringProxyInvocationHandler(Class<?> apiInterface, String prefix, Environment environment); @Override Object invoke(Object proxy, Method method, Object[] args); @Override String toString(); }
SpringProxyInvocationHandler implements InvocationHandler { @Override public String toString() { StringBuilder builder = new StringBuilder(apiInterface.getSimpleName()).append('{'); methodWrappers.forEach((method, handler) -> { if (handler instanceof PropertyMethodHandler) { builder.append(handler).append(", "); } }); builder.setLength(builder.length() - 2); builder.append('}'); return builder.toString(); } SpringProxyInvocationHandler(Class<?> apiInterface, String prefix, Environment environment); @Override Object invoke(Object proxy, Method method, Object[] args); @Override String toString();  }