diff --git a/airbyte-commons/src/test/java/io/airbyte/commons/util/AutoCloseableIteratorsTest.java b/airbyte-commons/src/test/java/io/airbyte/commons/util/AutoCloseableIteratorsTest.java index 26f160c06a1f..145e6565454e 100644 --- a/airbyte-commons/src/test/java/io/airbyte/commons/util/AutoCloseableIteratorsTest.java +++ b/airbyte-commons/src/test/java/io/airbyte/commons/util/AutoCloseableIteratorsTest.java @@ -9,7 +9,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -18,6 +17,7 @@ import io.airbyte.commons.concurrency.VoidCallable; import java.util.Iterator; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Stream; import org.junit.jupiter.api.Test; @@ -38,7 +38,10 @@ void testFromIterator() throws Exception { @Test void testFromStream() throws Exception { - final Stream stream = spy(Stream.of("a", "b", "c")); + final AtomicBoolean isClosed = new AtomicBoolean(false); + final Stream stream = Stream.of("a", "b", "c"); + stream.onClose(() -> isClosed.set(true)); + final AutoCloseableIterator iterator = AutoCloseableIterators.fromStream(stream); assertNext(iterator, "a"); @@ -46,7 +49,7 @@ void testFromStream() throws Exception { assertNext(iterator, "c"); iterator.close(); - verify(stream).close(); + assertTrue(isClosed.get()); } private void assertNext(final Iterator iterator, final String value) { diff --git a/docker-compose.build-m1.yaml b/docker-compose.build-m1.yaml index 71e8dc4f6d5e..2dc62df2c91c 100644 --- a/docker-compose.build-m1.yaml +++ b/docker-compose.build-m1.yaml @@ -41,7 +41,7 @@ services: build: dockerfile: Dockerfile args: - ARCH: ${DOCKER_BUILD_ARCH} + DOCKER_BUILD_ARCH: ${DOCKER_BUILD_ARCH} JDK_VERSION: ${JDK_VERSION} context: airbyte-workers labels: