diff --git a/extensions/wrapper/client/src/test/java/de/sovity/edc/client/ContractDefinitionPageApiServiceTest.java b/extensions/wrapper/client/src/test/java/de/sovity/edc/client/ContractDefinitionPageApiServiceTest.java index 8235ef270..e896e1809 100644 --- a/extensions/wrapper/client/src/test/java/de/sovity/edc/client/ContractDefinitionPageApiServiceTest.java +++ b/extensions/wrapper/client/src/test/java/de/sovity/edc/client/ContractDefinitionPageApiServiceTest.java @@ -35,7 +35,7 @@ void setUp(EdcExtension extension) { @Test void contractDefinitionPage(ContractDefinitionService contractDefinitionService) { - //arrange + // arrange var client = TestUtils.edcClient(); var criterion = new Criterion("exampleLeft1", "EQ", "abc"); createContractDefinition(contractDefinitionService, "contractPolicy-id-1", "accessPolicy-id-1", criterion); @@ -43,8 +43,7 @@ void contractDefinitionPage(ContractDefinitionService contractDefinitionService) // act var result = client.uiApi().contractDefinitionPage(); - - //assert + // assert var contractDefinitions = result.getContractDefinitions(); assertThat(contractDefinitions).hasSize(1); var contractDefinition = contractDefinitions.get(0); @@ -68,6 +67,7 @@ void contractDefinitionPageSorting(ContractDefinitionService contractDefinitionS "contractPolicy-id-1", "accessPolicy-id-1", new Criterion("exampleLeft1", "EQ", "abc")); + TestUtils.wait(1); createContractDefinition( contractDefinitionService, "contractPolicy-id-2", @@ -106,7 +106,7 @@ void testContractDefinitionCreation(ContractDefinitionService contractDefinition // act var response = client.uiApi().createContractDefinition(contractDefinition); - //assert + // assert assertThat(response).isNotNull(); var contractDefinitions = contractDefinitionService.query(QuerySpec.max()).getContent().toList(); assertThat(contractDefinitions).hasSize(1); diff --git a/extensions/wrapper/client/src/test/java/de/sovity/edc/client/TestUtils.java b/extensions/wrapper/client/src/test/java/de/sovity/edc/client/TestUtils.java index 0662c0f0a..9ccf97a3d 100644 --- a/extensions/wrapper/client/src/test/java/de/sovity/edc/client/TestUtils.java +++ b/extensions/wrapper/client/src/test/java/de/sovity/edc/client/TestUtils.java @@ -67,4 +67,12 @@ public static EdcClient edcClient() { .managementApiKey(TestUtils.MANAGEMENT_API_KEY) .build(); } + + public static void wait(int seconds) { + try { + Thread.sleep(seconds * 1000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } }