Completed DDI API
This commit is contained in:
@@ -60,7 +60,7 @@ import ru.yandex.qatools.allure.annotations.Stories;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@ActiveProfiles({ "im", "test" })
|
@ActiveProfiles({ "im", "test" })
|
||||||
@Features("Component Tests - Controller RESTful API")
|
@Features("Component Tests - Direct Device Integration API")
|
||||||
@Stories("Artifact Download Resource")
|
@Stories("Artifact Download Resource")
|
||||||
public class ArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB {
|
public class ArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB {
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import ru.yandex.qatools.allure.annotations.Features;
|
|||||||
import ru.yandex.qatools.allure.annotations.Stories;
|
import ru.yandex.qatools.allure.annotations.Stories;
|
||||||
|
|
||||||
@ActiveProfiles({ "im", "test" })
|
@ActiveProfiles({ "im", "test" })
|
||||||
@Features("Component Tests - Controller RESTful API")
|
@Features("Component Tests - Direct Device Integration API")
|
||||||
@Stories("Cancel Action Resource")
|
@Stories("Cancel Action Resource")
|
||||||
public class CancelActionTest extends AbstractIntegrationTest {
|
public class CancelActionTest extends AbstractIntegrationTest {
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import ru.yandex.qatools.allure.annotations.Features;
|
|||||||
import ru.yandex.qatools.allure.annotations.Stories;
|
import ru.yandex.qatools.allure.annotations.Stories;
|
||||||
|
|
||||||
@ActiveProfiles({ "im", "test" })
|
@ActiveProfiles({ "im", "test" })
|
||||||
@Features("Component Tests - Controller RESTful API")
|
@Features("Component Tests - Direct Device Integration API")
|
||||||
@Stories("Config Data Resource")
|
@Stories("Config Data Resource")
|
||||||
public class ConfigDataTest extends AbstractIntegrationTest {
|
public class ConfigDataTest extends AbstractIntegrationTest {
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import ru.yandex.qatools.allure.annotations.Features;
|
|||||||
import ru.yandex.qatools.allure.annotations.Stories;
|
import ru.yandex.qatools.allure.annotations.Stories;
|
||||||
|
|
||||||
@ActiveProfiles({ "im", "test" })
|
@ActiveProfiles({ "im", "test" })
|
||||||
@Features("Component Tests - Controller RESTful API")
|
@Features("Component Tests - Direct Device Integration API")
|
||||||
@Stories("Deployment Action Resource")
|
@Stories("Deployment Action Resource")
|
||||||
public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
|
public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
|
||||||
|
|
||||||
|
|||||||
@@ -45,13 +45,11 @@ import ru.yandex.qatools.allure.annotations.Features;
|
|||||||
import ru.yandex.qatools.allure.annotations.Stories;
|
import ru.yandex.qatools.allure.annotations.Stories;
|
||||||
|
|
||||||
@ActiveProfiles({ "im", "test" })
|
@ActiveProfiles({ "im", "test" })
|
||||||
@Features("Component Tests - Controller RESTful API")
|
@Features("Component Tests - Direct Device Integration API")
|
||||||
@Stories("Root Poll Resource")
|
@Stories("Root Poll Resource")
|
||||||
// TODO: fully document tests -> @Description for long text and reasonable
|
|
||||||
// method name as short text
|
|
||||||
public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
|
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.")
|
@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)
|
@WithUser(tenantId = "tenantDoesNotExists", allSpPermissions = true, authorities = "ROLE_CONTROLLER", autoCreateTenant = false)
|
||||||
public void targetCannotBeRegisteredIfTenantDoesNotExistsButWhenExists() throws Exception {
|
public void targetCannotBeRegisteredIfTenantDoesNotExistsButWhenExists() throws Exception {
|
||||||
@@ -73,6 +71,7 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@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,
|
@WithUser(principal = "knownPrincipal", authorities = { SpPermission.READ_TARGET, SpPermission.UPDATE_TARGET,
|
||||||
SpPermission.CREATE_TARGET })
|
SpPermission.CREATE_TARGET })
|
||||||
public void targetPollDoesNotModifyAuditData() throws Exception {
|
public void targetPollDoesNotModifyAuditData() throws Exception {
|
||||||
@@ -104,11 +103,13 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Description("Ensures that server returns a not found response in case of empty controlloer ID.")
|
||||||
public void rootRsWithoutId() throws Exception {
|
public void rootRsWithoutId() throws Exception {
|
||||||
mvc.perform(get("/controller/v1/")).andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound());
|
mvc.perform(get("/controller/v1/")).andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@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 {
|
public void rootRsPlugAndPlay() throws Exception {
|
||||||
|
|
||||||
final long current = System.currentTimeMillis();
|
final long current = System.currentTimeMillis();
|
||||||
@@ -133,6 +134,7 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@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 {
|
public void rootRsNotModified() throws Exception {
|
||||||
final String etag = mvc.perform(get("/{tenant}/controller/v1/4711", tenantAware.getCurrentTenant()))
|
final String etag = mvc.perform(get("/{tenant}/controller/v1/4711", tenantAware.getCurrentTenant()))
|
||||||
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
||||||
@@ -197,6 +199,8 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@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 {
|
public void rootRsPrecommissioned() throws Exception {
|
||||||
final Target target = new Target("4711");
|
final Target target = new Target("4711");
|
||||||
targetManagement.createTarget(target);
|
targetManagement.createTarget(target);
|
||||||
@@ -219,6 +223,7 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Description("Ensures that the source IP address of the polling target is correctly stored in repository")
|
||||||
public void rootRsPlugAndPlayIpAddress() throws Exception {
|
public void rootRsPlugAndPlayIpAddress() throws Exception {
|
||||||
// test
|
// test
|
||||||
final String knownControllerId1 = "0815";
|
final String knownControllerId1 = "0815";
|
||||||
|
|||||||
Reference in New Issue
Block a user