Ejemplo n.º 1
0
  @Test
  public void insertAll() {
    List<Revision> list =
        ImmutableList.of(
            rev(dt(2015, 11, 5), "First commit"),
            rev(dt(2015, 11, 6), "Second commit"),
            rev(dt(2015, 11, 7), "Third commit"));

    assertSeq(list, 0, 0, 0);
    RevisionOrm.get(model()).insertAll(list);
    assertSeq(list, 1, 2, 3);

    List<Row1<REVISION_SEQ>> res =
        Sql.select(REVISION.SEQ())
            .from(REVISION)
            .compile(trx().dialect())
            .stream(trx())
            .collect(Collectors.toList());
    assertThat(res, hasSize(3));
    assertThat(
        res,
        equalTo(
            ImmutableList.<Row1<REVISION_SEQ>>builder()
                .add(Row1.of(REVISION.SEQ(1)))
                .add(Row1.of(REVISION.SEQ(2)))
                .add(Row1.of(REVISION.SEQ(3)))
                .build()));
  }
Ejemplo n.º 2
0
 final List<Motivo> parseMotivos(FixedLine line) {
   Set<Motivo> motivos = motivoParser.parse(line);
   return ImmutableList.copyOf(motivos);
 }