Skip to content

Commit

Permalink
code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
cgardens committed May 25, 2021
1 parent 3cb1caf commit dc10028
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static <T> Optional<T> last(List<T> list) {
* @param <T> type
* @return new list with elements of original reversed.
*/
public static <T> List<T> reverse(List<T> list) {
public static <T> List<T> reversed(List<T> list) {
final ArrayList<T> reversed = new ArrayList<>(list);
Collections.reverse(reversed);
return reversed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void testLast() {
@Test
void testReverse() {
final ArrayList<Integer> originalList = Lists.newArrayList(1, 2, 3);
assertEquals(List.of(3, 2, 1), MoreLists.reverse(originalList));
assertEquals(List.of(3, 2, 1), MoreLists.reversed(originalList));
assertEquals(List.of(1, 2, 3), originalList);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,16 +820,16 @@ private StandardCheckConnectionOutput runCheck(JsonNode config) throws WorkerExc

private void runSyncAndVerifyStateOutput(JsonNode config, List<AirbyteMessage> messages, ConfiguredAirbyteCatalog catalog) throws Exception {
final List<AirbyteMessage> destinationOutput = runSync(config, messages, catalog);
final AirbyteMessage expectedStateMessage = MoreLists.reverse(messages)
final AirbyteMessage expectedStateMessage = MoreLists.reversed(messages)
.stream()
.filter(m -> m.getType() == Type.STATE)
.findAny()
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("All message sets used for testing should include a state record"));

final AirbyteMessage actualStateMessage = MoreLists.reverse(destinationOutput)
final AirbyteMessage actualStateMessage = MoreLists.reversed(destinationOutput)
.stream()
.filter(m -> m.getType() == Type.STATE)
.findAny()
.findFirst()
.orElseGet(() -> {
fail("Destination failed to output state");
return null;
Expand Down

0 comments on commit dc10028

Please sign in to comment.