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