Search in sources :

Example 76 with Application

use of alien4cloud.model.application.Application in project alien4cloud by alien4cloud.

the class ApplicationStepDefinitions method the_application_can_be_found_in_ALIEN_with_its_new_image.

@Then("^the application can be found in ALIEN with its new image$")
public void the_application_can_be_found_in_ALIEN_with_its_new_image() throws Throwable {
    Application app = the_application_can_be_found_in_ALIEN();
    assertNotNull(app.getImageId());
}
Also used : Application(alien4cloud.model.application.Application) Then(cucumber.api.java.en.Then)

Example 77 with Application

use of alien4cloud.model.application.Application in project alien4cloud by alien4cloud.

the class ApplicationStepDefinitions method I_have_and_a_tag.

@Given("^I have an application tag \"([^\"]*)\"$")
public boolean I_have_and_a_tag(String tag) throws Throwable {
    Context.getInstance().registerRestResponse(getRestClientInstance().get("/rest/v1/applications/" + CURRENT_APPLICATION.getId()));
    Application application = JsonUtil.read(Context.getInstance().takeRestResponse(), Application.class).getData();
    assertTrue(application.getTags().contains(new Tag(tag, null)));
    return application.getTags().contains(new Tag(tag, null));
}
Also used : Tag(alien4cloud.model.common.Tag) Application(alien4cloud.model.application.Application) Given(cucumber.api.java.en.Given)

Example 78 with Application

use of alien4cloud.model.application.Application in project alien4cloud by alien4cloud.

the class ApplicationStepDefinitions method The_application_update_date_has_changed.

@Then("^The application update date has changed$")
public void The_application_update_date_has_changed() throws Throwable {
    Application application = CURRENT_APPLICATION;
    Assert.assertNotEquals(application.getCreationDate(), application.getLastUpdateDate());
}
Also used : Application(alien4cloud.model.application.Application) Then(cucumber.api.java.en.Then)

Example 79 with Application

use of alien4cloud.model.application.Application in project alien4cloud by alien4cloud.

the class ApplicationStepDefinitions method I_should_receive_an_application_without_as_user.

@Then("^I should receive an application without \"([^\"]*)\" as user$")
public void I_should_receive_an_application_without_as_user(String userName) throws Throwable {
    RestResponse<Application> response = JsonUtil.read(Context.getInstance().getRestResponse(), Application.class);
    Assert.assertNull(response.getError());
    Assert.assertNotNull(response.getData());
    Application application = response.getData();
    if (application.getUserRoles() != null) {
        Assert.assertFalse(application.getUserRoles().containsKey(userName));
    }
}
Also used : Application(alien4cloud.model.application.Application) Then(cucumber.api.java.en.Then)

Example 80 with Application

use of alien4cloud.model.application.Application in project alien4cloud by alien4cloud.

the class ApplicationStepDefinitions method The_application_can_be_found_in_ALIEN_with_its_set_to.

@And("^The application can be found in ALIEN with its \"([^\"]*)\" set to \"([^\"]*)\"$")
public void The_application_can_be_found_in_ALIEN_with_its_set_to(String fieldName, String fieldValue) throws Throwable {
    Application application = the_application_can_be_found_in_ALIEN();
    Assert.assertEquals(fieldValue, ReflectionUtil.getPropertyValue(application, fieldName).toString());
}
Also used : Application(alien4cloud.model.application.Application) And(cucumber.api.java.en.And)

Aggregations

Application (alien4cloud.model.application.Application)103 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)45 ApiOperation (io.swagger.annotations.ApiOperation)43 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)39 ApplicationEnvironment (alien4cloud.model.application.ApplicationEnvironment)38 Audit (alien4cloud.audit.annotation.Audit)28 List (java.util.List)14 Topology (org.alien4cloud.tosca.model.templates.Topology)14 Set (java.util.Set)12 DeploymentTopology (alien4cloud.model.deployment.DeploymentTopology)11 RestResponse (alien4cloud.rest.model.RestResponse)11 Collectors (java.util.stream.Collectors)11 Map (java.util.Map)10 ApplicationEnvironmentService (alien4cloud.application.ApplicationEnvironmentService)9 ApplicationTopologyVersion (alien4cloud.model.application.ApplicationTopologyVersion)9 Arrays (java.util.Arrays)9 When (cucumber.api.java.en.When)8 Deployment (alien4cloud.model.deployment.Deployment)7 RestResponseBuilder (alien4cloud.rest.model.RestResponseBuilder)7 ApplicationEnvironmentAuthorizationDTO (alien4cloud.rest.orchestrator.model.ApplicationEnvironmentAuthorizationDTO)7