korlov42 commented on a change in pull request #542:
URL: https://github.com/apache/ignite-3/pull/542#discussion_r793939536
##########
File path:
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/MockedStructuresTest.java
##########
@@ -171,25 +171,10 @@ 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);
- } catch (Throwable e) {
- assertTrue(IgniteTestUtils.hasCause(e,
- IgniteInternalException.class,
- "Table not found"
- ));
- }
-
- assertTrue(tableByIdCalled.get());
+ assertThrows(IgniteInternalException.class, () ->
schemaManager.tableById(tblId), "Table not found");
Review comment:
```suggestion
IgniteInternalException ex =
assertThrows(IgniteInternalException.class, () ->
schemaManager.tableById(tblId));
assertThat(ex.getMessage(), containsString("Table not found"));
```
--
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]