Test a simple get request with table and key @throws Exception
()
| 55 | * @throws Exception |
| 56 | */ |
| 57 | @Test |
| 58 | public void simpleGet() throws Exception { |
| 59 | final GetRequest get = new GetRequest(TABLE, KEY); |
| 60 | final ArrayList<KeyValue> row = new ArrayList<KeyValue>(1); |
| 61 | row.add(KV); |
| 62 | |
| 63 | when(regionclient.isAlive()).thenReturn(true); |
| 64 | doAnswer(new Answer<Object>() { |
| 65 | public Object answer(final InvocationOnMock invocation) { |
| 66 | get.getDeferred().callback(row); |
| 67 | return null; |
| 68 | } |
| 69 | }).when(regionclient).sendRpc(get); |
| 70 | |
| 71 | assertSame(row, client.get(get).joinUninterruptibly()); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Test a get that queries by family byte |