コード例 #1
0
 @Test
 public void serializeDeserializeStatusRequestTest() {
   StatusRequest request = new StatusRequest();
   final ByteBuffer serializedRequest = ByteBuffer.wrap(request.serialize());
   StatusRequest deserializedRequest = new StatusRequest(serializedRequest);
   assertEquals(request, deserializedRequest);
 }
コード例 #2
0
 @Test
 public void signatureTest() {
   StatusRequest request = new StatusRequest();
   final byte[] secret = new byte[] {1, 2, 3, 4, 5, 6};
   request.sign(secret);
   assertTrue(request.verifySignature(secret));
   final ByteBuffer serializedRequest = ByteBuffer.wrap(request.serialize());
   StatusRequest deserializedRequest = new StatusRequest(serializedRequest);
   assertEquals(request, deserializedRequest);
 }