dataset: codenet

code:
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DatabaseAccessObject {

    private static Logger s_logger = LoggerFactory.getLogger(DatabaseAccessObject.class);

    protected static void closePreparedStatement(PreparedStatement pstmt, String errorMessage) {
        try {
            if (pstmt != null) {
                pstmt.close();
            }
        } catch (SQLException e) {
            s_logger.warn(errorMessage, e);
        }
    }

}

prompt:
Instruction:
Write a unit test for the following java code snippet with junit.

project_name: Logger

class_name: DatabaseAccessObject


dataset: codenet

code:
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DatabaseAccessObject {

    private static Logger s_logger = LoggerFactory.getLogger(DatabaseAccessObject.class);

    protected static void closePreparedStatement(PreparedStatement pstmt, String errorMessage) {
        try {
            if (pstmt != null) {
                pstmt.close();
            }
        } catch (SQLException e) {
            s_logger.warn(errorMessage, e);
        }
    }

}

prompt:
Instruction:
Write a unit test for the following java code snippet with junit.

project_name: Logger


dataset: codenet

code:
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DatabaseAccessObject {

    private static Logger s_logger = LoggerFactory.getLogger(DatabaseAccessObject.class);

    protected static void closePreparedStatement(PreparedStatement pstmt, String errorMessage) {
        try {
            if (pstmt != null) {
                pstmt.close();
            }
        } catch (SQLException e) {
            s_logger.warn(errorMessage, e);
        }
    }

}

prompt:
Instruction:
Write a unit test for the following java code snippet with junit.

project_name: Logger