SearchEndpointMessageTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 12
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSearchEndpointAvailableMessageIsSuccessfullyHandled() 0 11 1
A testSearchEndpointRemovedMessageIsSuccessfullyHandled() 0 15 1
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
declare(strict_types = 1);
9
10
namespace PyzTest\Zed\MessageBroker\MessageHandlers\SearchHttp\Communication;
11
12
use Codeception\Test\Unit;
13
use PyzTest\Zed\MessageBroker\SearchHttpCommunicationTester;
14
15
/**
16
 * Auto-generated group annotations
17
 *
18
 * @group PyzTest
19
 * @group Zed
20
 * @group MessageBroker
21
 * @group MessageHandlers
22
 * @group SearchHttp
23
 * @group Communication
24
 * @group SearchEndpointMessageTest
25
 * Add your own group annotations below this line
26
 */
27
class SearchEndpointMessageTest extends Unit
28
{
29
    protected SearchHttpCommunicationTester $tester;
30
31
    public function testSearchEndpointAvailableMessageIsSuccessfullyHandled(): void
32
    {
33
        // Arrange
34
        $this->tester->removeHttpConfig();
35
        $searchEndpointAvailableTransfer = $this->tester->buildSearchEndpointAvailableTransfer();
36
37
        // Act
38
        $this->tester->handleSearchMessage($searchEndpointAvailableTransfer);
39
40
        // Assert
41
        $this->tester->assertSearchHttpConfigExistsForStore();
42
    }
43
44
    public function testSearchEndpointRemovedMessageIsSuccessfullyHandled(): void
45
    {
46
        // Arrange
47
        $this->tester->removeHttpConfig();
48
        $this->tester->handleSearchMessage(
49
            $this->tester->buildSearchEndpointAvailableTransfer(),
50
        );
51
52
        $searchEndpointRemovedTransfer = $this->tester->buildSearchEndpointRemovedTransfer();
53
54
        // Act
55
        $this->tester->handleSearchMessage($searchEndpointRemovedTransfer);
56
57
        // Assert
58
        $this->tester->assertSearchHttpConfigIsRemoved();
59
    }
60
}
61