@TestFactory
Stream<DynamicTest> success() {

    final Stream<DynamicTest> successful = IntStream.range(200, 207)
        .mapToObj(status -> new Response(status, "{}", new HashMap<>()))
        .map(response -> dynamicTest(
            format("testing status '%s'", response.getStatus()),
            () -> assertTrue(response.success())));
    final Stream<DynamicTest> unsuccessful = IntStream.range(400, 419)
        .mapToObj(status -> new Response(status, "{}", new HashMap<>()))
        .map(response -> dynamicTest(
            format("testing status '%s'", response.getStatus()),
            () -> assertFalse(response.success())
        ));
    return Stream.concat(successful, unsuccessful);
}