Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
change google signin to take credential from property
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Oct 7, 2013
1 parent 6b7a1fa commit 4b9cc89
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions functional-test/src/test/java/org/zanata/util/GoogleSignIn.java
Expand Up @@ -20,6 +20,7 @@
*/
package org.zanata.util;

import com.google.common.base.Strings;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
Expand Down Expand Up @@ -53,9 +54,11 @@ public static boolean googleIsReachable() {
}

/**
* Query the environment for a GOOGLEID variable and return the stated
* Query the property for a GOOGLEID variable and return the stated
* password that corresponds to the indicated username. Expects the variable
* to be in the form: GOOGLEID=username1:password1;username2:password2;...
* to be in the form:
* <p />
* {@literal mvn <goals> -DGOOGLEID=username1:password1;username2:password2;}
*
* @param username
* Username of username:password pair query
Expand All @@ -65,8 +68,9 @@ public static boolean googleIsReachable() {
public static String getSignIn(String username) {
String googlePass;
String empty = "";
googlePass = System.getenv("GOOGLEID");
if (googlePass == null || googlePass.isEmpty()) {
googlePass = System.getProperty("GOOGLEID");
if (Strings.isNullOrEmpty(googlePass)) {
log.info("Google open ID credential is not available");
return empty;
}

Expand Down

0 comments on commit 4b9cc89

Please sign in to comment.