public function testSerialize()
 {
     $claimCheck = new ClaimCheck('MyBucket', 'MyKey');
     $encodedValue = $this->sut->serialize($claimCheck);
     $actual = Json::decode($encodedValue, Json::TYPE_ARRAY);
     self::assertArrayHasKey('s3BucketName', $actual);
     self::assertEquals('MyBucket', $actual['s3BucketName']);
     self::assertArrayHasKey('s3Key', $actual);
     self::assertEquals('MyKey', $actual['s3Key']);
 }
 public function testReceiveAlteredReceiptHandle()
 {
     $this->sqsClient->method('__call')->with('receiveMessage')->willReturnCallback(function ($name, array $args) {
         $factory = new ClaimCheckFactory('MyBucket');
         $serializer = new ClaimCheckJsonSerializer();
         return new Result(['Messages' => [['Body' => $serializer->serialize($factory->create('MyKey')), 'ReceiptHandle' => 'MyReceiptHandle']]]);
     });
     $this->s3Client->method('__call')->with('getObject')->willReturnCallback(function ($name, array $args) {
         return new Result(['Body' => 'MyOriginalMessage']);
     });
     $actual = $this->sut->receiveMessage();
     self::assertInstanceOf(Result::class, $actual);
     self::assertContains('MyReceiptHandle', $actual->search('Messages[].ReceiptHandle|[0]'));
     self::assertContains('MyBucket', $actual->search('Messages[].ReceiptHandle|[0]'));
     self::assertContains('MyKey', $actual->search('Messages[].ReceiptHandle|[0]'));
 }
 /**
  * @param ClaimCheck $claimCheck
  * @return string
  * @throws ExceptionInterface
  */
 public function serialize(ClaimCheck $claimCheck)
 {
     return $this->serializer->serialize($claimCheck);
 }