Package feign

Examples of feign.RequestTemplate.headers()


   */
  @Test public void testAuthentication() {
    RequestTemplate template = new RequestTemplate();
    BasicAuthRequestInterceptor interceptor = new BasicAuthRequestInterceptor("Aladdin", "open sesame");
    interceptor.apply(template);
    Collection<String> actualValue = template.headers().get("Authorization");
    Collection<String> expectedValue = Collections.singletonList("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
    assertEquals(actualValue, expectedValue);
  }

  /**
 
View Full Code Here


  @Test public void testAuthenticationWhenUserPassAreTooLong() {
    RequestTemplate template = new RequestTemplate();
    BasicAuthRequestInterceptor interceptor = new BasicAuthRequestInterceptor("IOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIOIO",
              "101010101010101010101010101010101010101010");
    interceptor.apply(template);
    Collection<String> actualValue = template.headers().get("Authorization");
    Collection<String> expectedValue = Collections.
        singletonList("Basic SU9JT0lPSU9JT0lPSU9JT0lPSU9JT0lPSU9JT0lPSU9JT0lPSU86MTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEw");
    assertEquals(actualValue, expectedValue);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.