use of com.hedera.mirror.monitor.publish.transaction.TransactionType in project hedera-mirror-node by hashgraph.
the class ExpressionConverterImplTest method account.
@Test
void account() throws InvalidProtocolBufferException {
TransactionType type = TransactionType.ACCOUNT_CREATE;
when(transactionPublisher.publish(any())).thenReturn(response(type, 100));
assertThat(expressionConverter.convert("${account.foo}")).isEqualTo("0.0.100");
verify(transactionPublisher).publish(request.capture());
assertThat(request.getValue().getScenario().getProperties().getType()).isEqualTo(type);
}
use of com.hedera.mirror.monitor.publish.transaction.TransactionType in project hedera-mirror-node by hashgraph.
the class ExpressionConverterImplTest method nft.
@Test
void nft() throws InvalidProtocolBufferException {
TransactionType type = TransactionType.TOKEN_CREATE;
when(transactionPublisher.publish(any())).thenReturn(response(type, 101));
assertThat(expressionConverter.convert("${nft.foo}")).isEqualTo("0.0.101");
verify(transactionPublisher).publish(request.capture());
assertThat(request.getValue().getScenario().getProperties().getType()).isEqualTo(type);
}
use of com.hedera.mirror.monitor.publish.transaction.TransactionType in project hedera-mirror-node by hashgraph.
the class ExpressionConverterImplTest method topic.
@Test
void topic() throws InvalidProtocolBufferException {
TransactionType type = TransactionType.CONSENSUS_CREATE_TOPIC;
when(transactionPublisher.publish(any())).thenReturn(response(type, 100));
assertThat(expressionConverter.convert("${topic.foo}")).isEqualTo("0.0.100");
verify(transactionPublisher).publish(request.capture());
assertThat(request.getValue().getScenario().getProperties().getType()).isEqualTo(type);
}
use of com.hedera.mirror.monitor.publish.transaction.TransactionType in project hedera-mirror-node by hashgraph.
the class ExpressionConverterImplTest method map.
@Test
void map() throws InvalidProtocolBufferException {
Map<String, String> properties = Map.of("accountId", "0.0.100", "topicId", "${topic.fooBar_123}");
TransactionType type = TransactionType.CONSENSUS_CREATE_TOPIC;
when(transactionPublisher.publish(any())).thenReturn(response(type, 101));
assertThat(expressionConverter.convert(properties)).hasSize(2).containsEntry("accountId", "0.0.100").containsEntry("topicId", "0.0.101");
verify(transactionPublisher).publish(request.capture());
assertThat(request.getValue().getScenario().getProperties().getType()).isEqualTo(type);
}
use of com.hedera.mirror.monitor.publish.transaction.TransactionType in project hedera-mirror-node by hashgraph.
the class ExpressionConverterImplTest method errorPublishing.
@Test
void errorPublishing() throws InvalidProtocolBufferException {
TransactionType type = TransactionType.CONSENSUS_CREATE_TOPIC;
when(transactionPublisher.publish(any())).thenReturn(Mono.error(new TimeoutException("timeout"))).thenReturn(response(type, 100));
assertThat(expressionConverter.convert("${topic.foo}")).isEqualTo("0.0.100");
}
Aggregations