/**
  * @param OrderInterface         $order
  * @param ConfigurationInterface $configuration
  *
  * @return string
  * @throws OrderAutocompleteException
  */
 private function getSignature(OrderInterface $order, ConfigurationInterface $configuration)
 {
     try {
         $signature = $this->signatureCalculator->calculate($order, $configuration->getCredentials(), $configuration->getCredentials()->getSignatureAlgorithm());
     } catch (SignatureCalculatorException $exception) {
         throw new OrderAutocompleteException($exception->getMessage(), $exception->getCode(), $exception);
     }
     return $signature;
 }
 public function testSignature()
 {
     $credentials = new Credentials(self::MERCHANT_POS_ID, '456');
     $order = new Order();
     $algorithm = $this->getMockBuilder('Team3\\PayU\\SignatureCalculator\\Encoder\\Algorithms\\AlgorithmInterface')->getMock();
     $algorithm->expects($this->any())->method('getName')->willReturn(self::ALGORITHM);
     $signature = $this->signatureCalculator->calculate($order, $credentials, $algorithm);
     $this->assertEquals(sprintf(OrderSignatureCalculator::SIGNATURE_FORMAT, self::ENCODED_STRING, self::ALGORITHM, self::MERCHANT_POS_ID), $signature);
 }