Giter VIP home page Giter VIP logo

camunda-bpm-assert's Introduction

camunda logo camunda-bpm-assert

This little community-extension to camunda BPM wants to make it easier to write tests for BPMN process definitions executed with the camunda process engine. For that reason, a set of assertions based on Joel Costigliola's AssertJ rich assertions library for java are provided, as well as a few little helpers to make it a bit easier to drive you through your process.

Hopefully this will also make it easier to change your tests half a year after you have written them yourself!-) In short: more readable code - less spaghetti tests!

Spaghetti Test

Table of Contents

## Getting started ### Maven dependency

First, declare the camunda BPM maven repository - if you haven't yet done so. Then you find here the coordinates for including camunda-bpm-assert in Apache Maven Projects:

	<dependency>
	    <groupId>org.camunda.bpm.extension</groupId>
    	<artifactId>camunda-bpm-assert</artifactId>
    	<version>1.0</version>
    	<scope>test</scope>
	</dependency>
### Add a static import to your test class

Create your test case just as described in camunda BPM Testing. Then you just have to add the following static import:

	import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
### Start using camunda-bpm-assert!

Now you have access to all the assertions provided by the AssertJ library - plus the customised camunda BPM assertions provided by this library. Let's assume you want to assert that your process instance

  • was actually started
  • is waiting at a specific user task and
  • the task is yet unassigned, but waiting to be assigned to a user of a specific group:

Green Bar

Then write:

	assertThat(processInstance).isStarted()
		.task().hasDefinitionKey("edit")
			.hasCandidateGroup("SB-Personal")
			.isNotAssigned();

Green bar?

Green Bar

Congrats! You are successfully using camunda-bpm-assert. Find a more detailed description of the assertions and helper methods available in the camunda-bpm-assert User Guide.

## Resources ## Maintainer

Martin Schimak - eMail - GitHub - Blog

## License

Apache License, Version 2.0

camunda-bpm-assert's People

Contributors

martinschimak avatar jangalinski avatar zambrovski avatar hawky-4s- avatar rafacm avatar berndruecker avatar meyerdan avatar svenpolte avatar

Watchers

Jens Lindekamp avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.