import org.apache.commons.dbutils.DbUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.sonar.api.utils.MessageException;
import org.sonar.core.persistence.Database;
import org.sonar.core.persistence.dialect.MySql;
writeConnection.commit();
}
- private static MessageException processError(Exception e) {
- String message = String.format("Fail to migrate data, error is : %s", e.getMessage());
- LOGGER.error(message, e);
- throw MessageException.of(message);
+ private static RuntimeException processError(Exception e) {
+ throw new IllegalStateException(e);
}
@VisibleForTesting
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
-import org.sonar.api.utils.MessageException;
import org.sonar.core.persistence.Database;
import org.sonar.core.persistence.TestDatabase;
import org.sonar.core.persistence.dialect.Dialect;
);
fail();
} catch (Exception e) {
- assertThat(e).isInstanceOf(MessageException.class);
+ assertThat(e).isInstanceOf(IllegalStateException.class);
}
}
);
fail();
} catch (Exception e) {
- assertThat(e).isInstanceOf(MessageException.class);
+ assertThat(e).isInstanceOf(IllegalStateException.class);
}
}