Unit testing a method that takes a ResultSet as parameter : <p>How does one go about unit testing an object that can't be instantiated? Because currently I have a method that converts a ResultSet to an object but I'm unsure if this violates any programming principles.</p>

<pre><code>public CItem convert(ResultSet rs) {
    CItem ci = new CItem ();

    try {
        ci.setHinumber(rs.getString("id"));
        ci.setHostname(rs.getString("sysname"));
        ci.setOs(rs.getString("zos"));
        ci.setTenant(rs.getString("customer_name"));
        //ci.setInstallation(rs.getField("installation_name"));
    } catch (SQLException e) {
        e.printStackTrace();
    }
    return ci;
}
</code></pre>

<p>Do I need to look for a different way to approach this solely because it can't be unit tested? Or can I somehow fake a ResultSet object.</p>

<p>Any help would be appreciated.</p>
