use of com.hedera.services.state.serdes.DomainSerdes in project hedera-services by hashgraph.
the class HFileMetaSerdeTest method undoStaticMocking.
private void undoStaticMocking() {
HFileMetaSerde.serdes = new DomainSerdes();
HFileMetaSerde.setSerInFactory(SerializableDataInputStream::new);
HFileMetaSerde.setSerOutFactory(SerializableDataOutputStream::new);
HFileMetaSerde.setStreamContentDiscovery(JKeySerializer::byteStream);
}
use of com.hedera.services.state.serdes.DomainSerdes in project hedera-services by hashgraph.
the class TxnIdTest method serializeWorksForUserNonce.
@Test
void serializeWorksForUserNonce() throws IOException {
// setup:
subject = scheduledSubjectUserNonce();
// and:
dout = mock(SerializableDataOutputStream.class);
serdes = mock(DomainSerdes.class);
TxnId.serdes = serdes;
// given:
InOrder inOrder = Mockito.inOrder(serdes, dout);
// when:
subject.serialize(dout);
// then:
inOrder.verify(dout).writeSerializable(fcPayer, Boolean.TRUE);
inOrder.verify(serdes).serializeTimestamp(fcValidStart, dout);
inOrder.verify(dout).writeBoolean(true);
inOrder.verify(dout).writeBoolean(false);
verifyNoMoreInteractions(dout);
// cleanup:
TxnId.serdes = new DomainSerdes();
}
Aggregations