use of com.hederahashgraph.api.proto.java.ContractGetInfoResponse in project hedera-services by hashgraph.
the class GetContractInfoAnswerTest method recognizesMissingInfoWhenNoCtxGiven.
@Test
void recognizesMissingInfoWhenNoCtxGiven() throws Throwable {
// setup:
Query sensibleQuery = validQuery(ANSWER_ONLY, 5L, target);
given(view.infoForContract(asContract(target), aliasManager)).willReturn(Optional.empty());
// when:
Response response = subject.responseGiven(sensibleQuery, view, OK, 0L);
// then:
ContractGetInfoResponse opResponse = response.getContractGetInfo();
assertTrue(opResponse.hasHeader(), "Missing response header!");
assertEquals(INVALID_CONTRACT_ID, opResponse.getHeader().getNodeTransactionPrecheckCode());
}
use of com.hederahashgraph.api.proto.java.ContractGetInfoResponse in project hedera-services by hashgraph.
the class GetContractInfoAnswerTest method recognizesMissingInfoWhenCtxGiven.
@Test
void recognizesMissingInfoWhenCtxGiven() throws Throwable {
// setup:
Query sensibleQuery = validQuery(ANSWER_ONLY, 5L, target);
// when:
Response response = subject.responseGiven(sensibleQuery, view, OK, 0L, Collections.emptyMap());
// then:
ContractGetInfoResponse opResponse = response.getContractGetInfo();
assertTrue(opResponse.hasHeader(), "Missing response header!");
assertEquals(INVALID_CONTRACT_ID, opResponse.getHeader().getNodeTransactionPrecheckCode());
verify(view, never()).infoForContract(any(), any());
}
Aggregations