mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 04:40:05 -06:00
added skip on stable 3.0 tag (#7073)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
@skipOnStable3.0
|
||||
Feature: Deprovisioning notification
|
||||
As a user admin
|
||||
I want to inform users about shutting down and deprovisioning the instance
|
||||
@@ -11,9 +12,8 @@ Feature: Deprovisioning notification
|
||||
|
||||
Scenario: administrator creates a deprovisioning notification about shutting down the instance
|
||||
When the administrator creates a deprovisioning notification
|
||||
Then the HTTP status code should be "200"
|
||||
When user "Alice" lists all notifications
|
||||
Then the HTTP status code should be "200"
|
||||
And user "Alice" lists all notifications
|
||||
Then the HTTP status code of responses on each endpoint should be "200, 200" respectively
|
||||
And the JSON response should contain a notification message with the subject "Instance will be shut down and deprovisioned" and the message-details should match
|
||||
"""
|
||||
{
|
||||
@@ -152,7 +152,7 @@ Feature: Deprovisioning notification
|
||||
"""
|
||||
|
||||
|
||||
Scenario: administrator tries to delete the deprovisioning notification
|
||||
Scenario: administrator deletes the deprovisioning notification
|
||||
Given the administrator has created a deprovisioning notification
|
||||
When the administrator deletes the deprovisioning notification
|
||||
Then the HTTP status code should be "200"
|
||||
@@ -173,9 +173,8 @@ Feature: Deprovisioning notification
|
||||
|
||||
Scenario Outline: administrator creates a deprovisioning notification with different date formats
|
||||
When the administrator creates a deprovisioning notification for date "<deprovision_date>" of format "<deprovision_date_format>"
|
||||
Then the HTTP status code should be "200"
|
||||
When user "Alice" lists all notifications
|
||||
Then the HTTP status code should be "200"
|
||||
And user "Alice" lists all notifications
|
||||
Then the HTTP status code of responses on each endpoint should be "200, 200" respectively
|
||||
And the JSON response should contain a notification message with the subject "Instance will be shut down and deprovisioned" and the message-details should match
|
||||
"""
|
||||
{
|
||||
@@ -208,9 +207,8 @@ Feature: Deprovisioning notification
|
||||
Scenario Outline: administrator change a deprovisioning notification with different date formats
|
||||
Given the administrator has created a deprovisioning notification
|
||||
When the administrator creates a deprovisioning notification for date "<deprovision_date>" of format "<deprovision_date_format>"
|
||||
Then the HTTP status code should be "200"
|
||||
When user "Alice" lists all notifications
|
||||
Then the HTTP status code should be "200"
|
||||
And user "Alice" lists all notifications
|
||||
Then the HTTP status code of responses on each endpoint should be "200, 200" respectively
|
||||
And the JSON response should contain a notification message with the subject "Instance will be shut down and deprovisioned" and the message-details should match
|
||||
"""
|
||||
{
|
||||
|
||||
@@ -114,6 +114,7 @@ class NotificationContext implements Context {
|
||||
$headers
|
||||
);
|
||||
$this->featureContext->setResponse($response);
|
||||
$this->featureContext->pushToLastHttpStatusCodesArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -516,8 +517,6 @@ class NotificationContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator creates a deprovisioning notification
|
||||
* @When user :user tries to create a deprovisioning notification
|
||||
*
|
||||
* @param string|null $user
|
||||
* @param string|null $deprovision_date
|
||||
@@ -533,10 +532,10 @@ class NotificationContext implements Context {
|
||||
?string $user = null,
|
||||
?string $deprovision_date = "2043-07-04T11:23:12Z",
|
||||
?string $deprovision_date_format= "2006-01-02T15:04:05Z07:00"
|
||||
):void {
|
||||
):ResponseInterface {
|
||||
$payload["type"] = "deprovision";
|
||||
$payload["data"] = ["deprovision_date" => $deprovision_date, "deprovision_date_format" => $deprovision_date_format];
|
||||
$response = OcsApiHelper::sendRequest(
|
||||
return OcsApiHelper::sendRequest(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$user ? $this->featureContext->getActualUsername($user) : $this->featureContext->getAdminUsername(),
|
||||
$user ? $this->featureContext->getPasswordForUser($user) : $this->featureContext->getAdminPassword(),
|
||||
@@ -546,7 +545,23 @@ class NotificationContext implements Context {
|
||||
json_encode($payload),
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator creates a deprovisioning notification
|
||||
* @When user :user tries to create a deprovisioning notification
|
||||
*
|
||||
* @param string|null $user
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function theAdministratorCreatesADeprovisioningNotification(?string $user = null) {
|
||||
$response = $this->userCreatesDeprovisioningNotification($user);
|
||||
$this->featureContext->setResponse($response);
|
||||
$this->featureContext->pushToLastHttpStatusCodesArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -561,7 +576,9 @@ class NotificationContext implements Context {
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function theAdministratorCreatesADeprovisioningNotificationUsingDateFormat($deprovision_date, $deprovision_date_format) {
|
||||
$this->userCreatesDeprovisioningNotification(null, $deprovision_date, $deprovision_date_format);
|
||||
$response = $this->userCreatesDeprovisioningNotification(null, $deprovision_date, $deprovision_date_format);
|
||||
$this->featureContext->setResponse($response);
|
||||
$this->featureContext->pushToLastHttpStatusCodesArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -315,7 +315,8 @@ class SettingsContext implements Context {
|
||||
$this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), $body)
|
||||
);
|
||||
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(
|
||||
Assert::assertEquals(
|
||||
$this->featureContext->getResponse()->getStatusCode(),
|
||||
201,
|
||||
"Expected response status code should be 201"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user