@Test public void shouldCreateOrderFromResultSet() throws Exception { when(resultSet.getString("receiver")).thenReturn("receiver"); when(resultSet.getString("subject")).thenReturn("subject"); when(resultSet.getString("content")).thenReturn("content"); when(resultSet.getLong("id")).thenReturn(1L); EmailMessage emailMessage = emailMessageRowMapper.mapRow(resultSet, 1); assertThat(emailMessage.getTo()[0], is("receiver")); assertThat(emailMessage.getSubject(), is("subject")); assertThat(emailMessage.getText(), is("content")); assertThat(emailMessage.getId(), is(1L)); }
@Override public EmailMessage mapRow(ResultSet rs, int rowNum) throws SQLException { EmailMessage emailMessage = new EmailMessage(); emailMessage.setTo(rs.getString("receiver")); emailMessage.setSubject(rs.getString("subject")); emailMessage.setText(rs.getString("content")); emailMessage.setHtml(rs.getBoolean("isHtml")); emailMessage.setId(rs.getLong("id")); return emailMessage; }
EmailMessageRowMapper implements RowMapper<EmailMessage> { @Override public EmailMessage mapRow(ResultSet rs, int rowNum) throws SQLException { EmailMessage emailMessage = new EmailMessage(); emailMessage.setTo(rs.getString("receiver")); emailMessage.setSubject(rs.getString("subject")); emailMessage.setText(rs.getString("content")); emailMessage.setHtml(rs.getBoolean("isHtml")); emailMessage.setId(rs.getLong("id")); return emailMessage; } }
EmailMessageRowMapper implements RowMapper<EmailMessage> { @Override public EmailMessage mapRow(ResultSet rs, int rowNum) throws SQLException { EmailMessage emailMessage = new EmailMessage(); emailMessage.setTo(rs.getString("receiver")); emailMessage.setSubject(rs.getString("subject")); emailMessage.setText(rs.getString("content")); emailMessage.setHtml(rs.getBoolean("isHtml")); emailMessage.setId(rs.getLong("id")); return emailMessage; }  }
EmailMessageRowMapper implements RowMapper<EmailMessage> { @Override public EmailMessage mapRow(ResultSet rs, int rowNum) throws SQLException { EmailMessage emailMessage = new EmailMessage(); emailMessage.setTo(rs.getString("receiver")); emailMessage.setSubject(rs.getString("subject")); emailMessage.setText(rs.getString("content")); emailMessage.setHtml(rs.getBoolean("isHtml")); emailMessage.setId(rs.getLong("id")); return emailMessage; }  @Override EmailMessage mapRow(ResultSet rs, int rowNum); }
EmailMessageRowMapper implements RowMapper<EmailMessage> { @Override public EmailMessage mapRow(ResultSet rs, int rowNum) throws SQLException { EmailMessage emailMessage = new EmailMessage(); emailMessage.setTo(rs.getString("receiver")); emailMessage.setSubject(rs.getString("subject")); emailMessage.setText(rs.getString("content")); emailMessage.setHtml(rs.getBoolean("isHtml")); emailMessage.setId(rs.getLong("id")); return emailMessage; }  @Override EmailMessage mapRow(ResultSet rs, int rowNum);  }