1 package org.davidmoten.rx.jdbc;
2
3 import static org.junit.Assert.assertTrue;
4
5 import org.junit.Ignore;
6 import org.junit.Test;
7
8 public class TxImplTest {
9
10 @Test
11 public void testToString() {
12 String s = Database.test().select("select score from person order by score")
13 .transactedValuesOnly()
14 .getAs(Integer.class)
15 .map(tx -> tx.toString())
16 .firstOrError()
17 .blockingGet();
18 assertTrue(s.startsWith("TxImpl ["));
19 }
20
21 @Test
22 public void testToStringCompletes() {
23 String s = Database.test()
24 .select("select score from person order by score")
25 .transacted()
26 .getAs(Integer.class)
27 .lastOrError()
28 .map(tx -> tx.toString())
29 .blockingGet();
30 assertTrue(s.startsWith("TxImpl ["));
31 }
32
33 @Test
34 @Ignore
35
36 public void testToStringForError() {
37 String s = Database.test()
38 .select("select scorezzz from person order by score")
39 .transacted()
40 .getAs(Integer.class)
41 .lastOrError()
42 .map(tx -> tx.toString())
43 .blockingGet();
44 assertTrue(s.startsWith("TxImpl ["));
45 }
46
47 }