use of ai.grakn.grpc.TxGrpcCommunicator in project grakn by graknlabs.
the class GrpcServerTest method whenGettingANonExistentConcept_ReturnNothing.
@Test
public void whenGettingANonExistentConcept_ReturnNothing() throws InterruptedException {
ConceptId id = ConceptId.of("V123456");
when(tx.getConcept(id)).thenReturn(null);
try (TxGrpcCommunicator tx = TxGrpcCommunicator.create(stub)) {
tx.send(openRequest(MYKS, GraknTxType.READ));
tx.receive().ok();
tx.send(GrpcUtil.getConceptRequest(id));
GrpcConcept.OptionalConcept response = tx.receive().ok().getOptionalConcept();
assertEquals(GrpcConcept.OptionalConcept.ValueCase.ABSENT, response.getValueCase());
}
}
Aggregations