You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/03/29 09:57:13 UTC

[GitHub] [incubator-shardingsphere] betterjava edited a comment on issue #2127: #2126 add SQLLoggerTest

betterjava edited a comment on issue #2127: #2126 add SQLLoggerTest
URL: https://github.com/apache/incubator-shardingsphere/pull/2127#issuecomment-477932991
 
 
   @terrymanu PowerMock can do this work.
   ```
           Logger log = PowerMockito.mock(Logger.class);
           PowerMockito.mockStatic(LoggerFactory.class);
           PowerMockito.when(LoggerFactory.getLogger("ShardingSphere-SQL")).thenReturn(log);
           SQLLogger.logSQL("select * from user", Arrays.asList("db1", "db2"));
           InOrder inOrder = Mockito.inOrder(log);
           inOrder.verify(log).info("Rule Type: master-slave", new Object[]{});
           inOrder.verify(log).info("SQL: {} ::: DataSources: {}", new Object[]{ "select * from user","db1,db2"});
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services