-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RELEASE] Replace flix-tech with wikimedia avro fork for 1.2 (#24)
[RELEASE] Replace flix-tech with wikimedia avro fork for 1.2
- Loading branch information
Showing
8 changed files
with
101 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
SCHEMA_REGISTRY_HOST="http://172.68.0.103:8081" | ||
SCHEMA_REGISTRY_HOST="http://192.168.104.103:8081" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FlixTech\AvroSerializer\Test\Objects; | ||
|
||
use FlixTech\AvroSerializer\Objects\DefaultRecordSerializerFactory; | ||
use FlixTech\AvroSerializer\Objects\RecordSerializer; | ||
use FlixTech\AvroSerializer\Test\AbstractFunctionalTestCase; | ||
|
||
/** | ||
* @group integration | ||
*/ | ||
class RecordSerializerIntegrationTest extends AbstractFunctionalTestCase | ||
{ | ||
/** | ||
* @test | ||
* | ||
* @throws \FlixTech\SchemaRegistryApi\Exception\SchemaRegistryException | ||
*/ | ||
public function it_encodes_valid_records(): RecordSerializer | ||
{ | ||
$serializer = DefaultRecordSerializerFactory::get(\getenv('SCHEMA_REGISTRY_HOST')); | ||
$encoded = $serializer->encodeRecord('test-value', $this->avroSchema, self::TEST_RECORD); | ||
$decoded = $serializer->decodeMessage($encoded); | ||
|
||
$this->assertEquals(self::TEST_RECORD, $decoded); | ||
|
||
return $serializer; | ||
} | ||
|
||
/** | ||
* @test | ||
* | ||
* @depends it_encodes_valid_records | ||
* | ||
* @expectedException \FlixTech\SchemaRegistryApi\Exception\IncompatibleAvroSchemaException | ||
* | ||
* @param \FlixTech\AvroSerializer\Objects\RecordSerializer $serializer | ||
* | ||
* @throws \FlixTech\SchemaRegistryApi\Exception\SchemaRegistryException | ||
*/ | ||
public function it_cannot_evolve_incompatible_schema(RecordSerializer $serializer): void | ||
{ | ||
$serializer->encodeRecord('test-value', $this->invalidSchema, self::TEST_RECORD); | ||
} | ||
|
||
/** | ||
* @test | ||
* | ||
* @depends it_encodes_valid_records | ||
* | ||
* @param \FlixTech\AvroSerializer\Objects\RecordSerializer $serializer | ||
* | ||
* @return \FlixTech\AvroSerializer\Objects\RecordSerializer | ||
* | ||
* @throws \FlixTech\SchemaRegistryApi\Exception\SchemaRegistryException | ||
*/ | ||
public function it_decodes_with_readers_schema(RecordSerializer $serializer): RecordSerializer | ||
{ | ||
$encoded = $serializer->encodeRecord('test-value', $this->avroSchema, self::TEST_RECORD); | ||
$decoded = $serializer->decodeMessage($encoded, $this->readersSchema); | ||
|
||
$this->assertEquals(self::READERS_TEST_RECORD, $decoded); | ||
|
||
return $serializer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<?php | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
(new Dotenv\Dotenv(__DIR__ . '/..', '.env.dist'))->load(); |
This file was deleted.
Oops, something went wrong.