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

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

There is a newer version: 1.22.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 NumberValueTooHighExceptionTest {

  @Test
  void shouldGetExceptionInformation() {
    NumberValueTooHighException exception = NumberValueTooHighException.builder().field("myField").maxValue("42").value("1337").build();

    assertThat(exception.type()).isEqualTo(AssertionErrorType.NUMBER_VALUE_TOO_HIGH);
    assertThat(exception.field()).isEqualTo("myField");
    assertThat(exception.parameters()).containsOnly(entry("max", "42"), entry("value", "1337"));
    assertThat(exception.getMessage()).isEqualTo("Value of field \"myField\" must be at most 42 but was 1337");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy