Skip to content

Commit

Permalink
fix(github): Put back github endpoint configuration (#726) (#731)
Browse files Browse the repository at this point in the history
* fix(github): Put back github endpoint configuration

* Removed useless test
  • Loading branch information
spinnakerbot authored and Travis Tomsu committed Dec 16, 2019
1 parent acca50a commit 771a15b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.netflix.spinnaker.echo.github.GithubService;
import com.netflix.spinnaker.retrofit.Slf4jRetrofitLogger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -32,11 +33,12 @@
@ConditionalOnProperty("github-status.enabled")
@Slf4j
public class GithubConfig {
static final String GITHUB_STATUS_URL = "https://api.github.com";

@Value("${github-status.endpoint:'https://api.github.com'}")
private String endpoint;

@Bean
public Endpoint githubEndpoint() {
String endpoint = GITHUB_STATUS_URL;
return Endpoints.newFixedEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.netflix.spinnaker.echo.config

import spock.lang.Specification
import spock.lang.Subject
import retrofit.Endpoint

class GithubConfigSpec extends Specification {
@Subject
GithubConfig githubConfig = new GithubConfig()

def 'test github incoming endpoint is correctly setted'() {
given:
String ownEndpoint = "https://github.myendpoint.com"
githubConfig.endpoint = ownEndpoint;

when:
Endpoint endpoint = githubConfig.githubEndpoint()

then:
endpoint.url == ownEndpoint
}

}

0 comments on commit 771a15b

Please sign in to comment.