Skip to content

Commit

Permalink
ally styleci
Browse files Browse the repository at this point in the history
  • Loading branch information
norbybaru committed Oct 18, 2023
1 parent 5e3434e commit eee42c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/Builder/TimestreamPayloadBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TimestreamPayloadBuilder
protected ?Carbon $time = null;

public function __construct(
protected string $measureName,
protected string $measureName,
protected mixed $measureValue = null,
protected ?ValueTypeEnum $measureValueType = null
) {
Expand Down Expand Up @@ -90,7 +90,7 @@ public function toRecords(): array

public static function make(string $measureName): self
{
return new self($measureName);
return new self($measureName);
}

public function toArray(): array
Expand Down Expand Up @@ -124,4 +124,4 @@ public function toArray(): array

return $metric;
}
}
}
8 changes: 4 additions & 4 deletions tests/Feature/PayloadWriterFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

use Illuminate\Support\Arr;
use Illuminate\Support\Carbon;
use NorbyBaru\AwsTimestream\Tests\TestCase;
use NorbyBaru\AwsTimestream\TimestreamService;
use NorbyBaru\AwsTimestream\Enum\ValueTypeEnum;
use NorbyBaru\AwsTimestream\Dto\TimestreamWriterDto;
use NorbyBaru\AwsTimestream\Builder\CommonPayloadBuilder;
use NorbyBaru\AwsTimestream\Builder\TimestreamPayloadBuilder;
use NorbyBaru\AwsTimestream\Dto\TimestreamWriterDto;
use NorbyBaru\AwsTimestream\Enum\ValueTypeEnum;
use NorbyBaru\AwsTimestream\Tests\TestCase;
use NorbyBaru\AwsTimestream\TimestreamService;

class PayloadWriterFeatureTest extends TestCase
{
Expand Down
13 changes: 6 additions & 7 deletions tests/Unit/WriterUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace NorbyBaru\AwsTimestream\Tests\Unit;

use Illuminate\Support\Carbon;
use NorbyBaru\AwsTimestream\Tests\TestCase;
use NorbyBaru\AwsTimestream\TimestreamBuilder;
use NorbyBaru\AwsTimestream\Enum\ValueTypeEnum;
use NorbyBaru\AwsTimestream\Dto\TimestreamWriterDto;
use NorbyBaru\AwsTimestream\Builder\CommonPayloadBuilder;
use NorbyBaru\AwsTimestream\Contract\PayloadBuilderContract;
use NorbyBaru\AwsTimestream\Builder\TimestreamPayloadBuilder;
use NorbyBaru\AwsTimestream\Contract\PayloadBuilderContract;
use NorbyBaru\AwsTimestream\Dto\TimestreamWriterDto;
use NorbyBaru\AwsTimestream\Enum\ValueTypeEnum;
use NorbyBaru\AwsTimestream\Tests\TestCase;
use NorbyBaru\AwsTimestream\TimestreamBuilder;

class WriterUnitTest extends TestCase
{
Expand Down Expand Up @@ -240,7 +240,6 @@ public function test_it_should_return_correct_dto_structure_for_batch_ingestion_
$this->assertArrayHasKey('Records', $payload);
$this->assertArrayHasKey('TableName', $payload);


$payload = [
...TimestreamPayloadBuilder::make(measureName: 'cpu_usage')
->setMeasureValue(value: $this->faker->randomFloat(5, 1, 100))
Expand Down Expand Up @@ -326,7 +325,7 @@ public function test_it_should_include_common_attributes_data()
$payload = $timestreamWriter->toArray();

$this->assertArrayHasKey('CommonAttributes', $payload);
$commonAttributes = $payload['CommonAttributes'];
$commonAttributes = $payload['CommonAttributes'];

$this->assertArrayHasKey('MeasureValueType', $commonAttributes);
$this->assertArrayHasKey('Time', $commonAttributes);
Expand Down

0 comments on commit eee42c3

Please sign in to comment.