Middle in our company told me to replace this code:
`assertAll(
<code> () -> assertDoesNotThrow(() -> $(".modal-title").shouldBe(visible)),
() -> assertEquals("Adding notes", $(".modal").getText()),
() ->
Stream.of(Notes.values())
.map(field -> $textField(field.get()).shouldBe(empty, visible)));`
</code>
<code> () -> assertDoesNotThrow(() -> $(".modal-title").shouldBe(visible)),
() -> assertEquals("Adding notes", $(".modal").getText()),
() ->
Stream.of(Notes.values())
.map(field -> $textField(field.get()).shouldBe(empty, visible)));`
</code>
() -> assertDoesNotThrow(() -> $(".modal-title").shouldBe(visible)),
() -> assertEquals("Adding notes", $(".modal").getText()),
() ->
Stream.of(Notes.values())
.map(field -> $textField(field.get()).shouldBe(empty, visible)));`
with this one:
`Stream assertStream = Stream.of(Notes.values()) .map(field -> () -> $textField(field.get()).shouldBe(empty, visible));
assertAll(
<code> () -> assertDoesNotThrow(() -> $(".modal-title").shouldBe(visible)),
() -> assertEquals("Adding notes", $(".modal").getText()),
() -> assertAll(assertStream));
</code>
<code> () -> assertDoesNotThrow(() -> $(".modal-title").shouldBe(visible)),
() -> assertEquals("Adding notes", $(".modal").getText()),
() -> assertAll(assertStream));
</code>
() -> assertDoesNotThrow(() -> $(".modal-title").shouldBe(visible)),
() -> assertEquals("Adding notes", $(".modal").getText()),
() -> assertAll(assertStream));
`
Please tell me why the middle option is better? I understand that it is more readable, but maybe there are some technical features?
New contributor
m fff is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.