Search in sources :

Example 6 with BuildStateTypeHandlerCallback

use of com.thoughtworks.go.server.dao.handlers.BuildStateTypeHandlerCallback in project gocd by gocd.

the class BuildStateTypeHandlerCallbackTest method shouldSerialize.

@Test
public void shouldSerialize() throws SQLException {
    PreparedStatement ps = mock(PreparedStatement.class);
    BuildStateTypeHandlerCallback callback = new BuildStateTypeHandlerCallback(JobState.class);
    callback.setParameter(ps, 42, JobState.Completed, null);
    verify(ps).setString(42, "Completed");
    verifyNoMoreInteractions(ps);
}
Also used : PreparedStatement(java.sql.PreparedStatement) BuildStateTypeHandlerCallback(com.thoughtworks.go.server.dao.handlers.BuildStateTypeHandlerCallback) Test(org.junit.jupiter.api.Test)

Aggregations

BuildStateTypeHandlerCallback (com.thoughtworks.go.server.dao.handlers.BuildStateTypeHandlerCallback)6 JobState (com.thoughtworks.go.domain.JobState)4 Test (org.junit.jupiter.api.Test)4 ResultSet (java.sql.ResultSet)2 Expectations (org.jmock.Expectations)2 Test (org.junit.Test)2 ParameterSetter (com.ibatis.sqlmap.client.extensions.ParameterSetter)1 CallableStatement (java.sql.CallableStatement)1 PreparedStatement (java.sql.PreparedStatement)1