Example usage for org.apache.commons.lang.builder ReflectionToStringBuilder toString

List of usage examples for org.apache.commons.lang.builder ReflectionToStringBuilder toString

Introduction

In this page you can find the example usage for org.apache.commons.lang.builder ReflectionToStringBuilder toString.

Prototype

public static String toString(Object object) 

Source Link

Document

Builds a toString value using the default ToStringStyle through reflection.

Usage

From source file:uk.co.sdev.async.http.AbstractParallel2SequentialCompletableFutureTest.java

@Test
public void shouldReturnNoneIfDivideReturnsServiceUnavailable() throws Exception {
    stubGet("/numerator", new Numerator(new BigDecimal("7.2")));
    stubGet("/denominator", new Denominator(new BigDecimal("2.5")));
    stubGet("/divide/7.2/2.5", 503);

    HandOff<Optional<Quotient>> handOff = new HandOff<>();

    sequential(parallel(getNumerator(), getDenominator()), divideFunc)
            .whenComplete((quotient, throwable) -> handOff.put(quotient));

    Optional<Quotient> quotient = handOff.get(3);
    assertThat(quotient.isPresent(), is(false));

    List<LoggedRequest> gets = findAll(getRequestedFor(urlMatching(".*")));
    for (LoggedRequest get : gets) {
        System.out.println(ReflectionToStringBuilder.toString(get));
    }//from   w w  w  .j a v a2  s  . co m
    assertThat(gets.size(), is(3));
}