title: Google BigQuery :User is not a trusted tester
body: <p>I am using Big query sample code to work with big query. I am getting the following error while reading dataset list using the big query api.</p>
  
  <p>The code is </p>
  
  <pre><code>Bigquery bigquery = Bigquery.builder(httpTransport, jsonFactory)
          .setHttpRequestInitializer(requestInitializer)
          .setJsonHttpRequestInitializer(new JsonHttpRequestInitializer() {
            public void initialize(JsonHttpRequest request) {
              BigqueryRequest bigqueryRequest = (BigqueryRequest) request;
              bigqueryRequest.setPrettyPrint(true);
            }
          }).build();
  
  
          Datasets.List datasetRequest = bigquery.datasets().list(PROJECT_ID);
          DatasetList datasetList = datasetRequest.execute();
          if (datasetList.getDatasets() != null) {
            java.util.List datasets = datasetList.getDatasets();
            for (Object  dataset : datasets) {
              System.out.format("%s\n", ((com.google.api.services.bigquery.model.DatasetList.Datasets)dataset).getDatasetReference().getDatasetId());
            }
          }
  </code></pre>
  
  <p>The exception is </p>
  
  <pre><code>Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized
  {
    "code" : 401,
    "errors" : [ {
      "domain" : "global",
      "location" : "Authorization",
      "locationType" : "header",
      "message" : "User is not a trusted tester",
      "reason" : "authError"
    } ],
    "message" : "User is not a trusted tester"
  }
      at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:159)
      at com.google.api.client.googleapis.json.GoogleJsonResponseException.execute(GoogleJsonResponseException.java:187)
      at com.google.api.client.googleapis.services.GoogleClient.executeUnparsed(GoogleClient.java:115)
      at com.google.api.client.http.json.JsonHttpRequest.executeUnparsed(JsonHttpRequest.java:112)
      at com.google.api.services.bigquery.Bigquery$Datasets$List.execute(Bigquery.java:964)
      at ShortSample.main(ShortSample.java:74
  </code></pre>
  
  <p>)</p>
  
  <p>I don't see this as an authentication issue as I could use the same code to connect to Google Plus account via Google plus api. I also observed that api examples are stale.</p>
  
  <p>Any Suggestions to fix it.</p>