@Test
void insufficientBalance() {

    final Response response = Response.status(400)
        .entity(INSUFFICIENT_BALANCE.getReason()
            .get())
        .build();
    final ClientErrorException ex = new BadRequestException(response);
    assertThat(InvestmentResult.failure(ex))
        .matches(r -> !r.isSuccess())
        .matches(r -> r.getFailureType()
            .isPresent() &&
                r.getFailureType()
                    .get() == INSUFFICIENT_BALANCE);
}