Class AbstractBooleanAssert<SELF extends AbstractBooleanAssert<SELF>>

    • Constructor Detail

      • AbstractBooleanAssert

        protected AbstractBooleanAssert​(Boolean actual,
                                        Class<?> selfType)
    • Method Detail

      • isTrue

        public SELF isTrue()
        Verifies that the actual value is true.

        Example:

         // assertions will pass
         assertThat(true).isTrue();
         assertThat(Boolean.TRUE).isTrue();
        
         // assertions will fail
         assertThat(false).isTrue();
         assertThat(Boolean.FALSE).isTrue();
        Returns:
        this assertion object.
        Throws:
        AssertionError - if the actual value is null.
        AssertionError - if the actual value is not true.
      • isFalse

        public SELF isFalse()
        Verifies that the actual value is false.

        Example:

         // assertions will pass
         assertThat(false).isFalse();
         assertThat(Boolean.FALSE).isFalse();
        
         // assertions will fail
         assertThat(true).isFalse();
         assertThat(Boolean.TRUE).isFalse();
        Returns:
        this assertion object.
        Throws:
        AssertionError - if the actual value is null.
        AssertionError - if the actual value is not false.
      • isEqualTo

        public SELF isEqualTo​(boolean expected)
        Verifies that the actual value is equal to the given one.

        Example:

         // assertions will pass
         assertThat(true).isEqualTo(true);
         assertThat(Boolean.FALSE).isEqualTo(false);
        
         // assertions will fail
         assertThat(true).isEqualTo(false);
         assertThat(Boolean.TRUE).isEqualTo(false);
        Parameters:
        expected - the given value to compare the actual value to.
        Returns:
        this assertion object.
        Throws:
        AssertionError - if the actual value is null.
        AssertionError - if the actual value is not equal to the given one.
      • isNotEqualTo

        public SELF isNotEqualTo​(boolean other)
        Verifies that the actual value is not equal to the given one.

        Example:

         // assertions will pass
         assertThat(true).isNotEqualTo(false);
         assertThat(Boolean.FALSE).isNotEqualTo(true);
        
         // assertions will fail
         assertThat(true).isNotEqualTo(true);
         assertThat(Boolean.FALSE).isNotEqualTo(false);
        Parameters:
        other - the given value to compare the actual value to.
        Returns:
        this assertion object.
        Throws:
        AssertionError - if the actual value is null.
        AssertionError - if the actual value is equal to the given one.