diff --git a/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/BookCliTest.java b/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/BookCliTest.java index 6847b48..47cad7a 100644 --- a/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/BookCliTest.java +++ b/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/BookCliTest.java @@ -18,10 +18,10 @@ import com.exactpro.cradle.BookId; import com.exactpro.cradle.BookInfo; +import com.exactpro.cradle.CradleManager; import com.exactpro.cradle.CradleStorage; import com.exactpro.th2.common.schema.factory.CommonFactory; import com.exactpro.th2.test.annotations.Th2AppFactory; -import com.exactpro.th2.test.annotations.Th2TestFactory; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -37,8 +37,8 @@ public class BookCliTest extends AbstractCliTest { @Test public void addBookTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); int initNumberOfBooks = cradleStorage.listBooks().size(); String bookName = "addBookTest"; @@ -54,8 +54,8 @@ public void addBookTest(@Th2AppFactory CommonFactory appFactory, @Test public void addBookWithoutTimeTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); int initNumberOfBooks = cradleStorage.listBooks().size(); Instant i1 = Instant.now(); @@ -74,8 +74,8 @@ public void addBookWithoutTimeTest(@Th2AppFactory CommonFactory appFactory, @Test public void addBookWithParamsTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); int initNumberOfBooks = cradleStorage.listBooks().size(); Instant created = Instant.now().minus(20, ChronoUnit.MINUTES); @@ -103,8 +103,8 @@ public void addBookWithParamsTest(@Th2AppFactory CommonFactory appFactory, @Test public void addExistedBookTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); int initNumberOfBooks = cradleStorage.listBooks().size(); String bookName = "addExistedBookTest"; diff --git a/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/PagesCliTest.java b/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/PagesCliTest.java index 27713b3..26a4e2f 100644 --- a/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/PagesCliTest.java +++ b/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/PagesCliTest.java @@ -18,12 +18,12 @@ import com.exactpro.cradle.BookId; import com.exactpro.cradle.BookInfo; +import com.exactpro.cradle.CradleManager; import com.exactpro.cradle.CradleStorage; import com.exactpro.cradle.PageId; import com.exactpro.cradle.PageInfo; import com.exactpro.th2.common.schema.factory.CommonFactory; import com.exactpro.th2.test.annotations.Th2AppFactory; -import com.exactpro.th2.test.annotations.Th2TestFactory; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -41,8 +41,8 @@ public class PagesCliTest extends AbstractCliTest { @Test public void addPageBeforeTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); String bookName = "addPageBeforeTest"; BookId bookId = new BookId(bookName); @@ -69,8 +69,8 @@ public void addPageBeforeTest(@Th2AppFactory CommonFactory appFactory, @Test public void addPageCurrentTimeTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); String bookName = "addPageCurrentTimeTest"; BookId bookId = new BookId(bookName); @@ -97,8 +97,8 @@ public void addPageCurrentTimeTest(@Th2AppFactory CommonFactory appFactory, @Test public void addPageCorrectTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); String bookName = "addPageCorrectTest"; BookId bookId = new BookId(bookName); @@ -128,8 +128,8 @@ public void addPageCorrectTest(@Th2AppFactory CommonFactory appFactory, @Test public void addPageWithoutNameTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); String bookName = "addPageWithoutNameTest"; BookId bookId = new BookId(bookName); @@ -158,8 +158,8 @@ public void addPageWithoutNameTest(@Th2AppFactory CommonFactory appFactory, @Test public void addPageWithParamsTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); String bookName = "addPageWithParamsTest"; BookId bookId = new BookId(bookName); @@ -192,8 +192,8 @@ public void addPageWithParamsTest(@Th2AppFactory CommonFactory appFactory, @Test public void addExistedPageTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); String bookName = "addExistedPageTest"; BookId bookId = new BookId(bookName); diff --git a/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/ViewersAllBooksTest.java b/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/ViewersAllBooksTest.java index 309fc60..7fc8c67 100644 --- a/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/ViewersAllBooksTest.java +++ b/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/ViewersAllBooksTest.java @@ -16,11 +16,11 @@ package com.exactpro.th2.cradle.adm.cli; +import com.exactpro.cradle.CradleManager; import com.exactpro.cradle.CradleStorage; import com.exactpro.th2.common.schema.factory.CommonFactory; import com.exactpro.th2.cradle.adm.TestBookPageBuilder; import com.exactpro.th2.test.annotations.Th2AppFactory; -import com.exactpro.th2.test.annotations.Th2TestFactory; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -34,8 +34,8 @@ public class ViewersAllBooksTest extends AbstractCliTest { @Test public void printAllBooksTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); String book1Name = "Book1"; Instant book1Start = Instant.now(); diff --git a/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/ViewersTest.java b/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/ViewersTest.java index 5957c5c..4ce931a 100644 --- a/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/ViewersTest.java +++ b/cradle-admin-tool-cli/src/test/java/com/exactpro/th2/cradle/adm/cli/ViewersTest.java @@ -18,13 +18,13 @@ import com.exactpro.cradle.BookId; import com.exactpro.cradle.BookInfo; +import com.exactpro.cradle.CradleManager; import com.exactpro.cradle.CradleStorage; import com.exactpro.cradle.PageInfo; import com.exactpro.cradle.utils.CradleStorageException; import com.exactpro.th2.common.schema.factory.CommonFactory; import com.exactpro.th2.cradle.adm.TestBookPageBuilder; import com.exactpro.th2.test.annotations.Th2AppFactory; -import com.exactpro.th2.test.annotations.Th2TestFactory; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -56,8 +56,8 @@ public void printUnknownBookTest(@Th2AppFactory CommonFactory appFactory) { @Test public void printBookTest(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); DBMetadata result = getInitData(cradleStorage, "printBookTest"); @@ -101,8 +101,8 @@ public void printBookTest(@Th2AppFactory CommonFactory appFactory, @Test public void printBookTest2(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); DBMetadata result = getInitData(cradleStorage, "printBookTest2"); @@ -132,8 +132,8 @@ public void printBookTest2(@Th2AppFactory CommonFactory appFactory, @Test public void printBookTestWithRemovedPages(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); DBMetadata result = getInitData(cradleStorage, "printBookTestWithRemovedPages"); @@ -175,8 +175,8 @@ public void printBookTestWithRemovedPages(@Th2AppFactory CommonFactory appFactor @Test public void printBookTestWithoutPages(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - CradleStorage cradleStorage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + CradleStorage cradleStorage = manager.getStorage(); DBMetadata result = getInitData(cradleStorage, "printBookTestWithoutPages"); diff --git a/cradle-admin-tool-http/src/test/java/com/exactpro/th2/cradle/adm/http/AbstractHttpTest.java b/cradle-admin-tool-http/src/test/java/com/exactpro/th2/cradle/adm/http/AbstractHttpTest.java index 745015d..a074e62 100644 --- a/cradle-admin-tool-http/src/test/java/com/exactpro/th2/cradle/adm/http/AbstractHttpTest.java +++ b/cradle-admin-tool-http/src/test/java/com/exactpro/th2/cradle/adm/http/AbstractHttpTest.java @@ -26,7 +26,6 @@ import com.exactpro.th2.common.schema.factory.CommonFactory; import com.exactpro.th2.test.annotations.Th2AppFactory; import com.exactpro.th2.test.annotations.Th2IntegrationTest; -import com.exactpro.th2.test.annotations.Th2TestFactory; import com.exactpro.th2.test.spec.CradleSpec; import org.eclipse.jetty.http.HttpTester; import org.eclipse.jetty.server.LocalConnector; @@ -59,8 +58,8 @@ public static void initStorage(CradleManager manager) { @BeforeEach public void init(@Th2AppFactory CommonFactory appFactory, - @Th2TestFactory CommonFactory testFactory) throws Exception { - this.storage = testFactory.getCradleManager().getStorage(); + CradleManager manager) throws Exception { + this.storage = manager.getStorage(); this.testHttpServer = new TestHttpServer(new Configuration(), appFactory.getCradleManager().getStorage()); this.testHttpServer.run(); this.connector = testHttpServer.getLocalConnector();