This file contains 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
// Needed to replace the component with a test specific one | |
@VisibleForTesting | |
public void setComponent(ApplicationComponent applicationComponent) { | |
this.applicationComponent = applicationComponent; | |
// we need to inject again, otherwise the objects here are the originals | |
// not the test ones as one would expect R.Pina 20160105 | |
this.applicationComponent.inject(this); | |
} |
This file contains 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
public Builder withClient() { | |
this.testClient = new TestGiphyClient(); | |
return this; | |
} | |
public Builder withUserManager(boolean real) { | |
if (real) { | |
this.userManager = new UserManagerImpl(); | |
} else { | |
this.userManager = new TestUserManager(); | |
} |
This file contains 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
@Rule | |
public final TestComponentRule component = new TestComponentRule.Builder() | |
.withClient() | |
.withUserManager(false) | |
.build(); |
This file contains 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
@Rule | |
public final TestComponentRule component = new TestComponentRule.Builder() | |
.withUserManager(true) | |
.build(); |
This file contains 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
machine: | |
environment: | |
PROJECT_GOPATH: "${HOME}/.go_project" | |
PROJECT_PARENT_PATH: "${PROJECT_GOPATH}/src/github.com/welnys" | |
PROJECT_PATH: "${PROJECT_PARENT_PATH}/${CIRCLE_PROJECT_REPONAME}" | |
GOPATH: "${HOME}/.go_workspace:/usr/local/go_workspace:${PROJECT_GOPATH}" | |
dependencies: | |
pre: | |
- go get -u github.com/kardianos/govendor |
This file contains 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
# Copied from their sample project | |
# https://github.com/CircleCI-Public/circleci-demo-go/blob/master/.circleci/config.yml | |
version: 2 | |
jobs: | |
build: | |
docker: | |
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/ | |
- image: circleci/golang:1.8 | |
# CircleCI MySQL images available at: https://hub.docker.com/r/circleci/mysql/ | |
- image: circleci/mysql:5.7 |
This file contains 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
environment: | |
- MYSQL_ALLOW_EMPTY_PASSWORD=true | |
- MYSQL_ROOT_HOST=% | |
- MYSQL_USER=ubuntu | |
- MYSQL_PASSWORD=ubuntu |
This file contains 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
# Get Go packages | |
- run: | |
name: Get Go packages | |
# go get. TODO: don't know why the command above is not enough. Probably gotta wait for golang/dep to be adopted. | |
command: | | |
go get github.com/jstemmer/go-junit-report \ | |
&& go get -u google.golang.org/appengine \ | |
&& go get -u github.com/golang/dep/cmd/dep \ | |
&& dep ensure \ | |
&& go get ./... |
This file contains 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
post: | |
- echo $GCLOUD_SERVICE_KEY | base64 --decode > ${HOME}/gcloud-service-key.json | |
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update | |
- sudo /opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json | |
- sudo /opt/google-cloud-sdk/bin/gcloud config set project welnys-api | |
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet components install app-engine-python | |
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet components install app-engine-go |
This file contains 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
# Google Cloud SDK. We need it to setup the environment with the commands below | |
# https://discuss.circleci.com/t/gcloud-permissions-error/2631/25 | |
- run: | |
name: Downloading Google Cloud SDK | |
command: | | |
curl -L -o google-cloud-sdk.zip https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.zip \ | |
&& unzip google-cloud-sdk.zip \ | |
&& rm google-cloud-sdk.zip \ | |
&& google-cloud-sdk/install.sh \ | |
--usage-reporting=false \ |