Completed DDI API

This commit is contained in:
Kai Zimmermann
2016-02-22 14:17:13 +01:00
parent 1ede39fb45
commit 94db219bcb
5 changed files with 13 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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";