swaroopak commented on a change in pull request #699: PHOENIX-5496 Ensure that
we handle all server-side mutation codes on the client
URL: https://github.com/apache/phoenix/pull/699#discussion_r374262945
##########
File path:
phoenix-core/src/test/java/org/apache/phoenix/schema/MetaDataClientTest.java
##########
@@ -0,0 +1,54 @@
+package org.apache.phoenix.schema;
+
+import org.apache.phoenix.coprocessor.MetaDataProtocol;
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.parse.CreateTableStatement;
+import org.apache.phoenix.parse.PSchema;
+import org.apache.phoenix.parse.SQLParser;
+import org.apache.phoenix.query.BaseConnectionlessQueryTest;
+import org.apache.phoenix.schema.types.PDataType;
+import org.apache.phoenix.util.EnvironmentEdgeManager;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.HashMap;
+import static junit.framework.Assert.fail;
+import static junit.framework.TestCase.assertEquals;
+import static org.mockito.Matchers.any;
+
+public class MetaDataClientTest extends BaseConnectionlessQueryTest {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(MetaDataClientTest.class);
+
+ @Test
+ public void testCreateTable() throws SQLException {
+ String schema = generateUniqueName();
+ String baseTable = generateUniqueName();
+ PhoenixConnection phxConn = (PhoenixConnection)
DriverManager.getConnection(getUrl());
+ MetaDataClient client = new MetaDataClient(phxConn);
+ MetaDataClient spyClient = Mockito.spy(client);
Review comment:
using spy implies code smell and hence should be avoided. Could you try with
dependency injection?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services