use of org.mariadb.jdbc.internal.stream.MaxAllowedPacketException in project pentaho-kettle by pentaho.
the class DatabaseLogExceptionFactoryTest method testExceptionStrategyWithMaxAllowedPacketException.
/**
* PDI-5153
* Test that in case of MaxAllowedPacketException exception there will be no stack trace in log (MariaDB)
*/
@Test
public void testExceptionStrategyWithMaxAllowedPacketException() {
DatabaseMeta databaseMeta = mock(DatabaseMeta.class);
DatabaseInterface databaseInterface = new MariaDBDatabaseMeta();
MaxAllowedPacketException e = new MaxAllowedPacketException();
when(logTable.getDatabaseMeta()).thenReturn(databaseMeta);
when(databaseMeta.getDatabaseInterface()).thenReturn(databaseInterface);
LogExceptionBehaviourInterface exceptionStrategy = DatabaseLogExceptionFactory.getExceptionStrategy(logTable, new KettleDatabaseException(e));
String strategyName = exceptionStrategy.getClass().getName();
assertEquals(SUPPRESSABLE_WITH_SHORT_MESSAGE, strategyName);
}
Aggregations