use of com.thoughtworks.go.domain.JobState in project gocd by gocd.
the class BuildStateTypeHandlerCallbackTest method shouldReturnStateWithIntegerColumnNameAndCallableStatement.
@Test
public void shouldReturnStateWithIntegerColumnNameAndCallableStatement() throws SQLException {
CallableStatement rs = mock(CallableStatement.class);
when(rs.getString(42)).thenReturn(JobState.Scheduled.toString());
BuildStateTypeHandlerCallback callback = new BuildStateTypeHandlerCallback(JobState.class);
JobState result = callback.getResult(rs, 42);
assertThat(result, is(JobState.Scheduled));
}
use of com.thoughtworks.go.domain.JobState in project gocd by gocd.
the class BuildStateTypeHandlerCallback method setParameter.
public void setParameter(ParameterSetter parameterSetter, Object parameter) throws SQLException {
JobState state = (JobState) parameter;
parameterSetter.setString(state.toString());
}
use of com.thoughtworks.go.domain.JobState in project gocd by gocd.
the class BuildStateTypeHandlerCallbackTest method shouldReturnStateWithIntegerColumnName.
@Test
public void shouldReturnStateWithIntegerColumnName() throws SQLException {
ResultSet rs = mock(ResultSet.class);
when(rs.getString(42)).thenReturn(JobState.Scheduled.toString());
BuildStateTypeHandlerCallback callback = new BuildStateTypeHandlerCallback(JobState.class);
JobState result = callback.getResult(rs, 42);
assertThat(result, is(JobState.Scheduled));
}
Aggregations