Skip to content

Instantly share code, notes, and snippets.

@zpapez
Created November 20, 2020 20:44
Show Gist options
  • Save zpapez/34fc13a3521dfca6c8ee78f19d76f5fc to your computer and use it in GitHub Desktop.
Save zpapez/34fc13a3521dfca6c8ee78f19d76f5fc to your computer and use it in GitHub Desktop.
Zephyr Feign Client
@FeignClient(name = "Zephyr", url = "${zephyr.api.baseUrl}", configuration = ZephyrFeignClientConfiguration.class)
public interface ZephyrFeignClient {
@RequestMapping(
value = "/execution",
method = RequestMethod.GET)
ExecutionListResponseDto getListOfExecutions(
@RequestParam(name = "issueId") String issueId);
}
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import feign.auth.BasicAuthRequestInterceptor;
public class ZephyrFeignClientConfiguration {
@Value("${zephyr.api.username}")
private String jiraApiUsername;
@Value("${zephyr.api.password}")
private String jiraApiPassword;
@Bean
public BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
return new BasicAuthRequestInterceptor(jiraApiUsername, jiraApiPassword);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment