All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generator.server.javatool.base.test.error.NullElementInCollectionExceptionTest.mustache Maven / Gradle / Ivy

There is a newer version: 1.23.0
Show newest version
package {{packageName}}.shared.error.domain;

import static org.assertj.core.api.Assertions.*;

import org.junit.jupiter.api.Test;
import {{packageName}}.UnitTest;

@UnitTest
class NullElementInCollectionExceptionTest {

  @Test
  void shouldGetExceptionInformation() {
    NullElementInCollectionException exception = new NullElementInCollectionException("myField");

    assertThat(exception.type()).isEqualTo(AssertionErrorType.NULL_ELEMENT_IN_COLLECTION);
    assertThat(exception.field()).isEqualTo("myField");
    assertThat(exception.parameters()).isEmpty();
    assertThat(exception.getMessage()).isEqualTo("The field \"myField\" contains a null element");
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy