@Test public void shouldCreateOrderFromResultSet() throws Exception { when(resultSet.getString("id")).thenReturn("5"); when(resultSet.getString("supplyLineId")).thenReturn("55"); Order order = orderRowMapper.mapRow(resultSet, 1); verify(resultSet).getString("id"); assertThat(order.getId(), is(5L)); assertThat(order.getRnr().getId(), is(5L)); assertThat(order.getSupplyLine().getId(), is(55L)); }
@Override public Order mapRow(ResultSet rs, int rowNum) throws SQLException { return new Order(new Rnr(Long.parseLong(rs.getString("id"))), new SupplyLine(Long.parseLong(rs.getString("supplyLineId")))); }
OrderRowMapper implements RowMapper { @Override public Order mapRow(ResultSet rs, int rowNum) throws SQLException { return new Order(new Rnr(Long.parseLong(rs.getString("id"))), new SupplyLine(Long.parseLong(rs.getString("supplyLineId")))); } }
OrderRowMapper implements RowMapper { @Override public Order mapRow(ResultSet rs, int rowNum) throws SQLException { return new Order(new Rnr(Long.parseLong(rs.getString("id"))), new SupplyLine(Long.parseLong(rs.getString("supplyLineId")))); }  }
OrderRowMapper implements RowMapper { @Override public Order mapRow(ResultSet rs, int rowNum) throws SQLException { return new Order(new Rnr(Long.parseLong(rs.getString("id"))), new SupplyLine(Long.parseLong(rs.getString("supplyLineId")))); }  @Override Order mapRow(ResultSet rs, int rowNum); }
OrderRowMapper implements RowMapper { @Override public Order mapRow(ResultSet rs, int rowNum) throws SQLException { return new Order(new Rnr(Long.parseLong(rs.getString("id"))), new SupplyLine(Long.parseLong(rs.getString("supplyLineId")))); }  @Override Order mapRow(ResultSet rs, int rowNum);  }