use of com.palantir.conjure.spec.ParameterType in project conjure by palantir.
the class ParamIdValidatorTest method testInvalidHeader.
@Test
public void testInvalidHeader() {
for (String paramId : ImmutableList.of("authorization", "123", "Foo_Bar", "Foo.Bar")) {
ParameterType parameterType = ParameterType.header(HeaderParameterType.of(ParameterId.of(paramId)));
assertThatThrownByEndpointValidation(parameterType).isInstanceOf(IllegalStateException.class).hasMessage("Header parameter id %s on endpoint test{http: POST /a/path} must match pattern %s", paramId, EndpointDefinitionValidator.HEADER_PATTERN);
}
}
Aggregations