|
31 | 31 | import com.github.shyiko.mysql.binlog.event.deserialization.QueryEventDataDeserializer;
|
32 | 32 | import com.github.shyiko.mysql.binlog.io.ByteArrayInputStream;
|
33 | 33 | import com.github.shyiko.mysql.binlog.network.AuthenticationException;
|
| 34 | +import com.github.shyiko.mysql.binlog.network.ServerException; |
34 | 35 | import org.mockito.InOrder;
|
35 | 36 | import org.testng.annotations.AfterClass;
|
36 | 37 | import org.testng.annotations.AfterMethod;
|
@@ -603,21 +604,13 @@ public void testExceptionIsThrownWhenProvidedWithWrongCredentials() throws Excep
|
603 | 604 | }
|
604 | 605 | }
|
605 | 606 |
|
606 |
| - @Test |
| 607 | + @Test(expectedExceptions = ServerException.class) |
607 | 608 | public void testExceptionIsThrownWhenInsufficientPermissionsToDetectPosition() throws Exception {
|
608 | 609 | ResourceBundle bundle = ResourceBundle.getBundle("jdbc");
|
609 | 610 | String prefix = "jdbc.mysql.replication.";
|
610 | 611 | String slaveUsername = bundle.getString(prefix + "slave.slaveUsername");
|
611 | 612 | String slavePassword = bundle.getString(prefix + "slave.slavePassword");
|
612 |
| - BinaryLogClient binaryLogClient = |
613 |
| - new BinaryLogClient(slave.hostname, slave.port, slaveUsername, slavePassword); |
614 |
| - |
615 |
| - try { |
616 |
| - binaryLogClient.connect(); |
617 |
| - fail("No REPLICATION CLIENT privilege should have resulted in IOException being thrown"); |
618 |
| - } catch (IOException e) { |
619 |
| - assertFalse(binaryLogClient.isConnected()); |
620 |
| - } |
| 613 | + new BinaryLogClient(slave.hostname, slave.port, slaveUsername, slavePassword).connect(); |
621 | 614 | }
|
622 | 615 |
|
623 | 616 | private void bindInSeparateThread(final TCPReverseProxy tcpReverseProxy) throws InterruptedException {
|
|
0 commit comments