Beispiel #1
0
        public async Task ShouldSendDeployResourceAndGetResponseAsExpected()
        {
            // given
            var expectedResponse = new DeployProcessResponse {
                Key = 1
            };

            expectedResponse.Processes.Add(new ProcessMetadata
            {
                BpmnProcessId        = "process",
                ResourceName         = _demoProcessPath,
                Version              = 1,
                ProcessDefinitionKey = 2
            });

            TestService.AddRequestHandler(typeof(DeployProcessRequest), request => expectedResponse);

            // when
            var deployProcessResponse = await ZeebeClient.NewDeployCommand()
                                        .AddResourceFile(_demoProcessPath)
                                        .Send();

            // then
            Assert.AreEqual(1, deployProcessResponse.Key);
            Assert.AreEqual(1, deployProcessResponse.Processes.Count);

            var processMetadata = deployProcessResponse.Processes[0];

            Assert.AreEqual("process", processMetadata.BpmnProcessId);
            Assert.AreEqual(1, processMetadata.Version);
            Assert.AreEqual(_demoProcessPath, processMetadata.ResourceName);
            Assert.AreEqual(2, processMetadata.ProcessDefinitionKey);
        }
 public DeployResponse(DeployProcessResponse response)
 {
     Key       = response.Key;
     Processes = response.Processes
                 .Select(metadata => new ProcessMetadata(metadata))
                 .Cast <IProcessMetadata>()
                 .ToList();
 }