From fa557e52afc2f5ebd03cc567902e7c9435bb2dc6 Mon Sep 17 00:00:00 2001 From: Azizbek Khushvakov Date: Tue, 2 Apr 2024 17:54:45 +0500 Subject: [PATCH] [MODORSERS-1026] - Fixed test --- .../java/org/folio/rest/impl/RoutingListsApiTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/folio/rest/impl/RoutingListsApiTest.java b/src/test/java/org/folio/rest/impl/RoutingListsApiTest.java index e9344a1c3..5c889f305 100644 --- a/src/test/java/org/folio/rest/impl/RoutingListsApiTest.java +++ b/src/test/java/org/folio/rest/impl/RoutingListsApiTest.java @@ -49,13 +49,15 @@ public class RoutingListsApiTest { private static final Logger logger = LogManager.getLogger(); - private static final String TEMPLATE_PROCESSING_REQUEST_ENDPOINT = "orders/routing-lists/" + ROUTING_LIST_ID + "/process-template"; + private static final String TEMPLATE_PROCESSING_REQUEST_ENDPOINT = "orders/routing-lists/" + ROUTING_LIST_ID + "/template"; private static boolean runningOnOwn; @Autowired private RoutingListsService routingListsService; private RequestContext requestContext; private Context ctxMock; private Map okapiHeadersMock; + private AutoCloseable mockitoMocks; + @BeforeAll static void before() throws InterruptedException, ExecutionException, TimeoutException { @@ -69,7 +71,7 @@ static void before() throws InterruptedException, ExecutionException, TimeoutExc @BeforeEach void beforeEach() { - MockitoAnnotations.openMocks(this); + mockitoMocks = MockitoAnnotations.openMocks(this); autowireDependencies(this); ctxMock = getFirstContextFromVertx(getVertx()); okapiHeadersMock = new HashMap<>(); @@ -81,7 +83,8 @@ void beforeEach() { } @AfterEach - void afterEach() { + void afterEach() throws Exception { + mockitoMocks.close(); clearServiceInteractions(); }