Search in sources :

Example 16 with BridgeReply

use of io.gravitee.cockpit.api.command.bridge.BridgeReply in project gravitee-management-rest-api by gravitee-io.

the class CockpitServiceTest method shouldProcessPromotion.

@Test
public void shouldProcessPromotion() {
    BridgeReply reply = new BridgeSimpleReply();
    reply.setCommandStatus(CommandStatus.SUCCEEDED);
    when(cockpitCommandService.send(any())).thenReturn(reply);
    final PromotionEntity promotionEntity = new PromotionEntity();
    final CockpitReply<PromotionEntity> result = cockpitService.processPromotion(promotionEntity);
    assertThat(result).isNotNull();
    assertThat(result.getStatus()).isEqualTo(CockpitReplyStatus.SUCCEEDED);
    final PromotionEntity entity = result.getReply();
    assertThat(entity).isNotNull();
}
Also used : BridgeSimpleReply(io.gravitee.cockpit.api.command.bridge.BridgeSimpleReply) PromotionEntity(io.gravitee.rest.api.model.promotion.PromotionEntity) BridgeReply(io.gravitee.cockpit.api.command.bridge.BridgeReply) Test(org.junit.Test)

Aggregations

BridgeReply (io.gravitee.cockpit.api.command.bridge.BridgeReply)16 BridgeCommand (io.gravitee.cockpit.api.command.bridge.BridgeCommand)14 Test (org.junit.Test)13 BridgePayload (io.gravitee.cockpit.api.command.bridge.BridgePayload)7 BridgeTarget (io.gravitee.cockpit.api.command.bridge.BridgeTarget)7 BridgeSimpleReply (io.gravitee.cockpit.api.command.bridge.BridgeSimpleReply)5 InstallationEntity (io.gravitee.rest.api.model.InstallationEntity)5 PromotionEntity (io.gravitee.rest.api.model.promotion.PromotionEntity)5 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)4 BridgeMultiReply (io.gravitee.cockpit.api.command.bridge.BridgeMultiReply)2 EnvironmentEntity (io.gravitee.rest.api.model.EnvironmentEntity)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 CommandStatus (io.gravitee.cockpit.api.command.CommandStatus)1 PromotionTargetEntity (io.gravitee.rest.api.model.promotion.PromotionTargetEntity)1 CockpitCommandService (io.gravitee.rest.api.service.cockpit.command.CockpitCommandService)1 BridgeCommandFactory (io.gravitee.rest.api.service.cockpit.command.bridge.BridgeCommandFactory)1 TechnicalManagementException (io.gravitee.rest.api.service.exceptions.TechnicalManagementException)1 Collections (java.util.Collections)1 List (java.util.List)1 Objects (java.util.Objects)1