From 94db219bcb87e2fbba75c0f69cc74fdeea0e79c8 Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Mon, 22 Feb 2016 14:17:13 +0100 Subject: [PATCH] Completed DDI API --- .../hawkbit/controller/ArtifactDownloadTest.java | 2 +- .../hawkbit/controller/CancelActionTest.java | 2 +- .../eclipse/hawkbit/controller/ConfigDataTest.java | 2 +- .../hawkbit/controller/DeploymentBaseTest.java | 2 +- .../hawkbit/controller/RootControllerTest.java | 13 +++++++++---- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ArtifactDownloadTest.java b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ArtifactDownloadTest.java index 2db088e64..b49f34b5f 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ArtifactDownloadTest.java +++ b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ArtifactDownloadTest.java @@ -60,7 +60,7 @@ import ru.yandex.qatools.allure.annotations.Stories; */ @ActiveProfiles({ "im", "test" }) -@Features("Component Tests - Controller RESTful API") +@Features("Component Tests - Direct Device Integration API") @Stories("Artifact Download Resource") public class ArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB { diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/CancelActionTest.java b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/CancelActionTest.java index e7b94cb30..d7e0351cf 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/CancelActionTest.java +++ b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/CancelActionTest.java @@ -40,7 +40,7 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) -@Features("Component Tests - Controller RESTful API") +@Features("Component Tests - Direct Device Integration API") @Stories("Cancel Action Resource") public class CancelActionTest extends AbstractIntegrationTest { diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ConfigDataTest.java b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ConfigDataTest.java index 4b6a135b2..a2b26c218 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ConfigDataTest.java +++ b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ConfigDataTest.java @@ -35,7 +35,7 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) -@Features("Component Tests - Controller RESTful API") +@Features("Component Tests - Direct Device Integration API") @Stories("Config Data Resource") public class ConfigDataTest extends AbstractIntegrationTest { diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/DeploymentBaseTest.java b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/DeploymentBaseTest.java index 2aabb0cba..2b2b7e597 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/DeploymentBaseTest.java +++ b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/DeploymentBaseTest.java @@ -52,7 +52,7 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) -@Features("Component Tests - Controller RESTful API") +@Features("Component Tests - Direct Device Integration API") @Stories("Deployment Action Resource") public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/RootControllerTest.java b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/RootControllerTest.java index 7dce6dc35..45bf5755b 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/RootControllerTest.java +++ b/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/RootControllerTest.java @@ -45,13 +45,11 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) -@Features("Component Tests - Controller RESTful API") +@Features("Component Tests - Direct Device Integration API") @Stories("Root Poll Resource") -// TODO: fully document tests -> @Description for long text and reasonable -// method name as short text public class RootControllerTest extends AbstractIntegrationTestWithMongoDB { - @Test() + @Test @Description("Ensures that targets cannot be created e.g. in plug'n play scenarios when tenant does not exists but can be created if the tenant exists.") @WithUser(tenantId = "tenantDoesNotExists", allSpPermissions = true, authorities = "ROLE_CONTROLLER", autoCreateTenant = false) public void targetCannotBeRegisteredIfTenantDoesNotExistsButWhenExists() throws Exception { @@ -73,6 +71,7 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB { } @Test + @Description("Ensures that target poll request does not change audit data on the entity.") @WithUser(principal = "knownPrincipal", authorities = { SpPermission.READ_TARGET, SpPermission.UPDATE_TARGET, SpPermission.CREATE_TARGET }) public void targetPollDoesNotModifyAuditData() throws Exception { @@ -104,11 +103,13 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB { } @Test + @Description("Ensures that server returns a not found response in case of empty controlloer ID.") public void rootRsWithoutId() throws Exception { mvc.perform(get("/controller/v1/")).andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound()); } @Test + @Description("Ensures that the system creates a new target in plug and play manner, i.e. target is authenticated but does not exist yet.") public void rootRsPlugAndPlay() throws Exception { final long current = System.currentTimeMillis(); @@ -133,6 +134,7 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB { } @Test + @Description("Ensures that etag check results in not modified response if provided etag by client is identical to entity in repository.") public void rootRsNotModified() throws Exception { final String etag = mvc.perform(get("/{tenant}/controller/v1/4711", tenantAware.getCurrentTenant())) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) @@ -197,6 +199,8 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB { } @Test + @Description("Ensures that the target state machine of a precomissioned target switches from " + + "UNKNOWN to REGISTERED when the target polls for the first time.") public void rootRsPrecommissioned() throws Exception { final Target target = new Target("4711"); targetManagement.createTarget(target); @@ -219,6 +223,7 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB { } @Test + @Description("Ensures that the source IP address of the polling target is correctly stored in repository") public void rootRsPlugAndPlayIpAddress() throws Exception { // test final String knownControllerId1 = "0815";