From 3bb84f8beff723676029ea71559c9f34f8bec8bc Mon Sep 17 00:00:00 2001 From: Alberto Codutti Date: Fri, 20 Dec 2024 18:10:51 +0100 Subject: [PATCH] :recycle: [Test] Added new set of test cases to test JobEngine Device Management Configuration Target Processors Signed-off-by: Alberto Codutti --- .../jobEngine/RunJobEngineServiceI9nTest.java | 9 ++- ...obEngineServiceProcessorCommandI9n.feature | 12 +-- ...neServiceProcessorConfigurationI9n.feature | 79 +++++++++++++++++++ 3 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorConfigurationI9n.feature diff --git a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java index 85210dfd101..408d12e1cee 100644 --- a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java +++ b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java @@ -19,11 +19,12 @@ @RunWith(Cucumber.class) @CucumberOptions( features = { -// "classpath:features/jobEngine/JobEngineServiceOperations.feature", -// "classpath:features/jobEngine/JobEngineServiceProcessorKeystoreI9n.feature", -// "classpath:features/jobEngine/JobEngineServiceProcessorAssetI9n.feature", -// "classpath:features/jobEngine/JobEngineServiceProcessorBundleI9n.feature", + "classpath:features/jobEngine/JobEngineServiceOperations.feature", + "classpath:features/jobEngine/JobEngineServiceProcessorAssetI9n.feature", + "classpath:features/jobEngine/JobEngineServiceProcessorBundleI9n.feature", "classpath:features/jobEngine/JobEngineServiceProcessorCommandI9n.feature", + "classpath:features/jobEngine/JobEngineServiceProcessorConfigurationI9n.feature", + "classpath:features/jobEngine/JobEngineServiceProcessorKeystoreI9n.feature", }, glue = { "org.eclipse.kapua.service.job.steps", diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorCommandI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorCommandI9n.feature index df4a09d0b78..d90db76b46b 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorCommandI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorCommandI9n.feature @@ -71,9 +71,9 @@ Feature: Job Engine Service - Command Step Processors And I confirm that job target in job has step index 0 and status "PROCESS_OK" # TODO: check that command has been executed when KuraMock gets refactored -# @teardown -# Scenario: Tear down test resources -# Given I logout -# And KuraMock is disconnected -# And Stop Docker environment -# And Clean Locator Instance \ No newline at end of file + @teardown + Scenario: Tear down test resources + Given I logout + And KuraMock is disconnected + And Stop Docker environment + And Clean Locator Instance \ No newline at end of file diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorConfigurationI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorConfigurationI9n.feature new file mode 100644 index 00000000000..cbe47417d0f --- /dev/null +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorConfigurationI9n.feature @@ -0,0 +1,79 @@ +############################################################################### +# Copyright (c) 2024, 2024 Eurotech and/or its affiliates and others +# +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Eurotech - initial API and implementation +############################################################################### +@env_docker +@it +@jobEngine +@jobEngineTargetProcessors + +Feature: Job Engine Service - Configuration Step Processors + Tests for Device Management Configuration Processor + + @setup + Scenario: Setup test resources + Given Init Security Context + And Start Docker environment with resources + | db | + | events-broker | + | job-engine | + | message-broker | + | broker-auth-service | + | consumer-lifecycle | + + Scenario: Configuration Put - XML + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I start the Kura Mock + And Device birth message is sent + And Device "rpione3" is connected within 10s + And I create a job with the name "TestJob" + And I add device targets to job + | rpione3 | + And I search for step definition with the name + | Configuration Put | + And I add job step to job with name "Test Step - Configuration Put - XML" and with selected job step definition and properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.demo.heater.Heater10 | + | timeout | java.lang.Long | 5000 | + When I start a job + And I wait job to finish its execution up to 10s + Then I confirm that job has 1 job execution + And I confirm that job target in job has step index 0 and status "PROCESS_OK" + # TODO: check that configuration has been applied when KuraMock gets refactored + + Scenario: Configuration Put - JSON + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I start the Kura Mock + And Device birth message is sent + And Device "rpione3" is connected within 10s + And I create a job with the name "TestJob" + And I add device targets to job + | rpione3 | + And I search for step definition with the name + | Configuration Put | + And I add job step to job with name "Test Step - Configuration Put - JSON" and with selected job step definition and properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | { "configuration": [{ "id": "org.eclipse.kura.demo.heater.Heater", "properties": { "property": [{ "name": "publish.rate", "array": false, "encrypted": false, "type": "Integer", "value": [ "10" ]} ]} }] } | + | timeout | java.lang.Long | 5000 | + When I start a job + And I wait job to finish its execution up to 10s + Then I confirm that job has 1 job execution + And I confirm that job target in job has step index 0 and status "PROCESS_OK" + # TODO: check that configuration has been applied when KuraMock gets refactored + + @teardown + Scenario: Tear down test resources + Given I logout + And KuraMock is disconnected + And Stop Docker environment + And Clean Locator Instance \ No newline at end of file