@SuppressWarnings("unchecked")
@Test(expected=InternalServerErrorException.class)
public void testGetWithSqlException() throws Exception {

    // Create the resource to be tested
    Users resource = new Users();
    // Create an UkelonnService with a mock database
    // that throws SqlException
    UserManagementServiceProvider useradmin = new UserManagementServiceProvider();
    PreparedStatement statement = mock(PreparedStatement.class);
    ResultSet results = mock(ResultSet.class);
    when(results.next()).thenThrow(SQLException.class);
    DataSource datasource = mock(DataSource.class);
    Connection connection = mock(Connection.class);
    when(datasource.getConnection()).thenReturn(connection);
    when(connection.prepareStatement(anyString())).thenReturn(statement);
    when(statement.executeQuery()).thenReturn(results);
    useradmin.setDataSource(datasource);
    // Inject the UkelonnService
    resource.useradmin = useradmin;
    // Inject a log service
    MockLogService logservice = new MockLogService();
    resource.logservice = logservice;
    useradmin.setLogservice(logservice);
    // Do a get operation that will fail
    resource.get();
    fail("Should never get here");
}