strongduanmu commented on a change in pull request #13485:
URL: https://github.com/apache/shardingsphere/pull/13485#discussion_r744109311
##########
File path:
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptProjectionTokenGeneratorTest.java
##########
@@ -46,26 +48,30 @@
import static org.mockito.Mockito.when;
public final class EncryptProjectionTokenGeneratorTest {
-
+
@Rule
public ExpectedException expectedException = ExpectedException.none();
-
+
private EncryptProjectionTokenGenerator encryptProjectionTokenGenerator;
-
+
@Before
public void setup() {
encryptProjectionTokenGenerator = new
EncryptProjectionTokenGenerator();
encryptProjectionTokenGenerator.setEncryptRule(buildEncryptRule());
}
-
+
@Test
public void assertOwnerExistsMatchTableAliasGenerateSQLTokens() {
ProjectionsSegment projectionsSegment = mock(ProjectionsSegment.class);
SelectStatementContext sqlStatementContext =
mock(SelectStatementContext.class, RETURNS_DEEP_STUBS);
when(sqlStatementContext.getSqlStatement().getProjections()).thenReturn(projectionsSegment);
+ SimpleTableSegment doctor = new SimpleTableSegment(new
TableNameSegment(1, 7, new IdentifierValue("doctor")));
+ doctor.setAlias(new AliasSegment(8, 9, new IdentifierValue("a")));
+ SimpleTableSegment doctor1 = new SimpleTableSegment(new
TableNameSegment(10, 17, new IdentifierValue("doctor1")));
+
Review comment:
@cheese8 Please remove this useless blank line.
##########
File path:
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptProjectionTokenGeneratorTest.java
##########
@@ -75,15 +81,41 @@ public void
assertOwnerExistsMatchTableAliasGenerateSQLTokens() {
Collection<SubstitutableColumnNameToken> tokens =
encryptProjectionTokenGenerator.generateSQLTokens(sqlStatementContext);
assertThat(tokens.size(), is(1));
}
-
+
+ @Test
+ public void assertOwnerExistsMatchTableAliasGenerateSQLTokens2() {
+ ProjectionsSegment projectionsSegment = mock(ProjectionsSegment.class);
+ SelectStatementContext sqlStatementContext =
mock(SelectStatementContext.class, RETURNS_DEEP_STUBS);
+
when(sqlStatementContext.getSqlStatement().getProjections()).thenReturn(projectionsSegment);
+ SimpleTableSegment doctor = new SimpleTableSegment(new
TableNameSegment(1, 7, new IdentifierValue("doctor")));
+ doctor.setAlias(new AliasSegment(8, 9, new IdentifierValue("a")));
+ SimpleTableSegment doctor1 = new SimpleTableSegment(new
TableNameSegment(10, 17, new IdentifierValue("doctor")));
+
Review comment:
@cheese8 Please remove this useless blank line.
##########
File path:
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptProjectionTokenGeneratorTest.java
##########
@@ -46,26 +48,30 @@
import static org.mockito.Mockito.when;
public final class EncryptProjectionTokenGeneratorTest {
-
+
@Rule
public ExpectedException expectedException = ExpectedException.none();
-
+
private EncryptProjectionTokenGenerator encryptProjectionTokenGenerator;
-
+
Review comment:
@cheese8 Please keep this space.
--
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]