korlov42 commented on a change in pull request #542:
URL: https://github.com/apache/ignite-3/pull/542#discussion_r792462598
##########
File path:
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/DdlWithMockedManagersTest.java
##########
@@ -156,11 +163,56 @@ void before() throws NodeStoppingException {
queryProc.start();
}
+ /**
+ * Checks that appropriate methods called form table manager on rel node
construction.
+ */
+ @Test
+ void checkAppropriateTableFound() throws Exception {
Review comment:
how this test relates to DDL operations?
##########
File path:
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/DdlWithMockedManagersTest.java
##########
@@ -156,11 +163,56 @@ void before() throws NodeStoppingException {
queryProc.start();
}
+ /**
+ * Checks that appropriate methods called form table manager on rel node
construction.
+ */
+ @Test
+ void checkAppropriateTableFound() throws Exception {
+ TableManager tableManager = mock(TableManager.class);
+
+ SqlSchemaManagerImpl schemaManager = new
SqlSchemaManagerImpl(tableManager, () -> {});
+ AtomicBoolean tableByIdCalled = new AtomicBoolean();
+ IgniteUuid tblId = new IgniteUuid(UUID.randomUUID(), 0);
+
+ when(tableManager.table(any(IgniteUuid.class))).thenAnswer((k) -> {
Review comment:
mockito has an API to verify whether particular method was called or
not. Please see `org.mockito.Mockito#verify(T)`
##########
File path:
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/DdlWithMockedManagersTest.java
##########
@@ -156,11 +163,56 @@ void before() throws NodeStoppingException {
queryProc.start();
}
+ /**
+ * Checks that appropriate methods called form table manager on rel node
construction.
+ */
+ @Test
+ void checkAppropriateTableFound() throws Exception {
+ TableManager tableManager = mock(TableManager.class);
+
+ SqlSchemaManagerImpl schemaManager = new
SqlSchemaManagerImpl(tableManager, () -> {});
+ AtomicBoolean tableByIdCalled = new AtomicBoolean();
+ IgniteUuid tblId = new IgniteUuid(UUID.randomUUID(), 0);
+
+ when(tableManager.table(any(IgniteUuid.class))).thenAnswer((k) -> {
+ tableByIdCalled.set(true);
+
+ return null;
+ });
+
+ try {
+ schemaManager.tableById(tblId);
Review comment:
assertThrows ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]