Skip to content

Commit b137f64

Browse files
authored
Merge branch 'main' into codex/keyvault-jca-system-proxy
2 parents 1a53118 + e8195c9 commit b137f64

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/models

sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/models/EventContextTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import com.azure.messaging.eventhubs.CheckpointStore;
77
import com.azure.messaging.eventhubs.EventData;
8+
import org.junit.jupiter.api.AfterEach;
89
import org.junit.jupiter.api.BeforeEach;
910
import org.junit.jupiter.api.Test;
1011
import org.mockito.ArgumentCaptor;
@@ -31,9 +32,18 @@ class EventContextTest {
3132
@Mock
3233
private EventData eventData;
3334

35+
private AutoCloseable mocksCloseable;
36+
3437
@BeforeEach
3538
void beforeEach() {
36-
MockitoAnnotations.initMocks(this);
39+
mocksCloseable = MockitoAnnotations.openMocks(this);
40+
}
41+
42+
@AfterEach
43+
void afterEach() throws Exception {
44+
if (mocksCloseable != null) {
45+
mocksCloseable.close();
46+
}
3747
}
3848

3949
/**

0 commit comments

Comments
 (0)