SlackClient { SlackMessageAPIRequest request(String channel, String message, String color) { var request = new SlackMessageAPIRequest(); request.channel = channel; var attachment = new SlackMessageAPIRequest.Attachment(); attachment.color = color; attachment.text = message; request.attachments = List.of(attachment); return request; } SlackClient(HTTPClient httpClient, String token); void send(String channel, String message, String color);  }
@Test void request() { SlackMessageAPIRequest request = client.request("channel", "message", "color"); assertThat(request.attachments).hasSize(1) .has(new Condition<>(attachment -> "message".equals(attachment.text), "attachment.text should be message"), atIndex(0)); }