use of feign.RequestTemplate in project feign by OpenFeign.
the class BasicAuthRequestInterceptorTest method addsAuthorizationHeader_longUserAndPassword.
@Test
public void addsAuthorizationHeader_longUserAndPassword() {
RequestTemplate template = new RequestTemplate();
BasicAuthRequestInterceptor interceptor = new BasicAuthRequestInterceptor("IOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIO", "101010101010101010101010101010101010101010");
interceptor.apply(template);
assertThat(template).hasHeaders(entry("Authorization", asList("Basic SU9JT0lPSU9JT0lPSU9JT0lPSU9JT0lPSU9JT0lPSU9JT0lPSU86MTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEw")));
}
use of feign.RequestTemplate in project feign by OpenFeign.
the class BasicAuthRequestInterceptorTest method addsAuthorizationHeader.
@Test
public void addsAuthorizationHeader() {
RequestTemplate template = new RequestTemplate();
BasicAuthRequestInterceptor interceptor = new BasicAuthRequestInterceptor("Aladdin", "open sesame");
interceptor.apply(template);
assertThat(template).hasHeaders(entry("Authorization", asList("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")));
}
use of feign.RequestTemplate in project feign by OpenFeign.
the class JAXBCodecTest method doesntEncodeParameterizedTypes.
@Test
public void doesntEncodeParameterizedTypes() throws Exception {
thrown.expect(UnsupportedOperationException.class);
thrown.expectMessage("JAXB only supports encoding raw types. Found java.util.Map<java.lang.String, ?>");
class ParameterizedHolder {
Map<String, ?> field;
}
Type parameterized = ParameterizedHolder.class.getDeclaredField("field").getGenericType();
RequestTemplate template = new RequestTemplate();
new JAXBEncoder(new JAXBContextFactory.Builder().build()).encode(Collections.emptyMap(), parameterized, template);
}
Aggregations