Created
November 20, 2020 20:44
-
-
Save zpapez/34fc13a3521dfca6c8ee78f19d76f5fc to your computer and use it in GitHub Desktop.
Zephyr Feign Client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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