Commit 8c3806b0 authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

fix: test order to overcome race condition

parent e90ce442
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -47,7 +47,10 @@ import org.etsi.osl.hypo.api.tmf.services.catalog.schema.ServiceSpecificationEnt
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.mockito.Mockito;
@@ -55,6 +58,7 @@ import org.mockito.Mockito;
@QuarkusTest
@QuarkusTestResource(value = InMemoryKafkaTestLifecycleManager.class)
@TestProfile(LoadDataOnStartUpTestProfile.class)
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class PeeringApiListenerKafkaTest {
    public static final Duration DURATION = Duration.ofSeconds(10);
    // used the organization with peered characteristic false in order to test all the implementation
@@ -100,6 +104,7 @@ class PeeringApiListenerKafkaTest {
    }

    @Test
    @Order(1)
    void shouldReceiveServiceSpecifications() {

        // PREPARE PAYLOAD
@@ -189,6 +194,7 @@ class PeeringApiListenerKafkaTest {
    }

    @Test
    @Order(2)
    void shouldReceiveUpdatedServiceSpecifications() {
        String specificationId = SPECIFICATION_ID;
        String secondSpecificationId = SECOND_SPECIFICATION_ID;
@@ -274,6 +280,7 @@ class PeeringApiListenerKafkaTest {

    @ParameterizedTest
    @ValueSource(strings = {PEERED_ORGANIZATION_HEARTBEAT_FAILURE, EAST_WEST_PEERING_TERMINATION})
    @Order(3)
    void shouldReceiveHeartBeatFailure(String channelName) {

        InMemorySource<String> incomingChannelForDeletionOrFailure = connector.source(channelName);
@@ -336,6 +343,7 @@ class PeeringApiListenerKafkaTest {
    }

    @Test
    @Order(4)
    void shouldReceivePeeringFailure() {
        InMemorySource<String> peeringSource = connector.source(EAST_WEST_PEERING_FAILURE);
        peeringSource.send(ORGANIZATION_ID);