Skip to content

Commit

Permalink
Fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangML committed Dec 13, 2024
1 parent ce2387a commit cb1cff7
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.shardingsphere.proxy.backend.handler.admin.executor.DatabaseAdminExecutor;
import org.apache.shardingsphere.proxy.backend.postgresql.handler.admin.PostgreSQLAdminExecutorCreator;
import org.apache.shardingsphere.sql.parser.statement.core.statement.dml.SelectStatement;
import org.apache.shardingsphere.sql.parser.statement.opengauss.dal.OpenGaussShowStatement;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -55,13 +56,11 @@ void setup() throws ReflectiveOperationException {
}

@Test
void assertNewInstanceWithSQLStatementContextOnly() {
void assertNewInstanceWithSQLStatementContext() {
SQLStatementContext sqlStatementContext = mock(SQLStatementContext.class);
DatabaseAdminExecutor expected = mock(DatabaseAdminExecutor.class);
when(postgresqlAdminExecutorFactory.create(sqlStatementContext)).thenReturn(Optional.of(expected));
when(sqlStatementContext.getSqlStatement()).thenReturn(new OpenGaussShowStatement("all"));
Optional<DatabaseAdminExecutor> actual = openGaussAdminExecutorFactory.create(sqlStatementContext);
assertTrue(actual.isPresent());
assertThat(actual.get(), is(expected));
}

@Test
Expand Down

0 comments on commit cb1cff7

Please sign in to comment.