Nav

Migrating Assert Processors (MUnit)

All assert event processors change of name space to 'assert'.
We are replacing all assert event processors with only one event processor.

Assert processor for MUnit 2.x

         
      
1
<assert:that expression="#[]" is="#[MunitTools::equalTo(...)]" message=""/>
The expression is expected.

Unary assertion should be implemented as shown below:

Assert Payload

Assert Payload in MUnit 1.x

         
      
1
<assert:payload-equals expectedValue="'#[['value 1','value 2']]"   message="oops!"/>
Assert Payload in MUnit 2.x

         
      
1
<assert:that expression="#[payload]" is="#[MunitTools::equalTo(['value 1','value 2'])]" message="oops!"/>

Assert Null

Assert Null in MUnit 1.x

         
      
1
<munit:assert-null message="oops!"/>
Assert Null in MUnit 2.x

         
      
1
<assert-that expression="#[payload]" is="#[MunitTools::nullValue()]" message="oops!"/>

Assert Not Null

Assert Not Null in MUnit 1.x

         
      
1
<munit:assert-not-null message="oops!"/>
Assert Not Null in MUnit 2.x

         
      
1
<assert-that expression="#[payload]" is="#[MunitTools::notNullValue()]" message="oops!"/>

Assert False

Assert False in MUnit 1.x

         
      
1
<munit:assert-false message="oops!" condition="#[ 1 != 1 || payload.length != 0]"/>
Assert False in MUnit 2.x

         
      
1
<assert:that expression="#[ 1 != 1 || payload.length != 0]" is="#[MunitTools::equalTo(false)]" message="oops!"/>

Assert True

Assert True in MUnit 1.x

         
      
1
<munit:assert-true message="oops!" condition="#[#[ 1 == 1 &amp;&amp; payload.length == 0]]" doc:name="Assert True"/>
Assert True in MUnit 2.x

         
      
1
<assert:that expression="#[ 1 != 1 || payload.length != 0]" is="#[MunitTools::equalTo(true)]" message="oops!"/>

Assert Fail

There are no changes in the syntax for the fail assertion processor:


         
      
1
<munit:fail message="This should not happen"/>

Binaries assertion should be implemented as shown below:

Assert Equals

Assert Equals in MUnit 1.x

         
      
1
<munit:assert-on-equals message="oops!" expectedValue="#['expected']" actualValue="#['actual_value']"/>
Assert Equals in MUnit 2.x

         
      
1
<assert:that expression="#['expected']" is="#[MunitTools::equalTo('actual_value')]" message="oops!" />

Assert Not Equals

Assert Not Equals in MUnit 1.x

         
      
1
<munit:assert-not-same message="oops!" expectedValue="#['']" actualValue="#[payload]"/>
Assert Not Equals in MUnit 2.x

         
      
1
<assert:that expression="#['expected']" is="#[MunitTools::not(equalTo('actual_value'))]" message="oops!" />

Assert Custom

There are no changes in the syntax for the custom asserting processor:


         
      
1
<munit:run-custom assertion-ref="your.package.customAssertion"/>

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+