generator.server.springboot.webflux.web.test.HeaderUtilTest.mustache Maven / Gradle / Ivy
package {{packageName}}.shared.error.infrastructure.primary;
import static org.assertj.core.api.Assertions.*;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpHeaders;
import {{packageName}}.UnitTest;
@UnitTest
class HeaderUtilTest {
@Test
void shouldCreateFailureAlertWithTranslation() {
HttpHeaders headers = HeaderUtil.createFailureAlert("myApp", "User", "404");
assertThat(headers.getFirst("X-myApp-error")).isEqualTo("error.404");
assertThat(headers.getFirst("X-myApp-params")).isEqualTo("User");
}
}