From 3324808be960ddd0b6dbbe696a7e373fe67cbfa8 Mon Sep 17 00:00:00 2001 From: Marco Ziccardi Date: Fri, 1 Apr 2016 16:07:20 +0200 Subject: [PATCH] Rename id to generatedId for BigQuery resources --- .../com/google/gcloud/bigquery/BigQuery.java | 19 ++++++------ .../com/google/gcloud/bigquery/Dataset.java | 4 +-- .../google/gcloud/bigquery/DatasetInfo.java | 29 +++++++++---------- .../java/com/google/gcloud/bigquery/Job.java | 4 +-- .../com/google/gcloud/bigquery/JobInfo.java | 28 +++++++++--------- .../com/google/gcloud/bigquery/Table.java | 4 +-- .../com/google/gcloud/bigquery/TableInfo.java | 28 +++++++++--------- .../gcloud/bigquery/DatasetInfoTest.java | 10 +++---- .../google/gcloud/bigquery/DatasetTest.java | 8 ++--- .../google/gcloud/bigquery/JobInfoTest.java | 20 ++++++------- .../com/google/gcloud/bigquery/JobTest.java | 10 +++---- .../gcloud/bigquery/SerializationTest.java | 10 +++---- .../google/gcloud/bigquery/TableInfoTest.java | 16 +++++----- .../com/google/gcloud/bigquery/TableTest.java | 8 ++--- .../gcloud/bigquery/it/ITBigQueryTest.java | 10 +++---- 15 files changed, 104 insertions(+), 104 deletions(-) diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BigQuery.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BigQuery.java index 2d864383e81a..d40cc8145feb 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BigQuery.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BigQuery.java @@ -471,9 +471,10 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) { Dataset getDataset(DatasetId datasetId, DatasetOption... options); /** - * Lists the project's datasets. This method returns partial information on each dataset - * ({@link Dataset#datasetId()}, {@link Dataset#friendlyName()} and {@link Dataset#id()}). To get - * complete information use either {@link #getDataset(String, DatasetOption...)} or + * Lists the project's datasets. This method returns partial information on each dataset: + * ({@link Dataset#datasetId()}, {@link Dataset#friendlyName()} and + * {@link Dataset#generatedId()}). To get complete information use either + * {@link #getDataset(String, DatasetOption...)} or * {@link #getDataset(DatasetId, DatasetOption...)}. * * @throws BigQueryException upon failure @@ -541,9 +542,9 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) { Table getTable(TableId tableId, TableOption... options); /** - * Lists the tables in the dataset. This method returns partial information on each table - * ({@link Table#tableId()}, {@link Table#friendlyName()}, {@link Table#id()} and type, which - * is part of {@link Table#definition()}). To get complete information use either + * Lists the tables in the dataset. This method returns partial information on each table: + * ({@link Table#tableId()}, {@link Table#friendlyName()}, {@link Table#generatedId()} and type, + * which is part of {@link Table#definition()}). To get complete information use either * {@link #getTable(TableId, TableOption...)} or * {@link #getTable(String, String, TableOption...)}. * @@ -552,9 +553,9 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) { Page listTables(String datasetId, TableListOption... options); /** - * Lists the tables in the dataset. This method returns partial information on each table - * ({@link Table#tableId()}, {@link Table#friendlyName()}, {@link Table#id()} and type, which - * is part of {@link Table#definition()}). To get complete information use either + * Lists the tables in the dataset. This method returns partial information on each table: + * ({@link Table#tableId()}, {@link Table#friendlyName()}, {@link Table#generatedId()} and type, + * which is part of {@link Table#definition()}). To get complete information use either * {@link #getTable(TableId, TableOption...)} or * {@link #getTable(String, String, TableOption...)}. * diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java index e17d3e82c4ef..215a0c662c3b 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java @@ -103,8 +103,8 @@ public Builder friendlyName(String friendlyName) { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/DatasetInfo.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/DatasetInfo.java index aa767b97631b..9f1d25f05925 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/DatasetInfo.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/DatasetInfo.java @@ -55,8 +55,7 @@ public Dataset apply(DatasetInfo datasetInfo) { return datasetInfo.toPb(); } }; - - private static final long serialVersionUID = -6615133444520365839L; + private static final long serialVersionUID = 8469473744160758489L; private final DatasetId datasetId; private final List acl; @@ -65,7 +64,7 @@ public Dataset apply(DatasetInfo datasetInfo) { private final String description; private final String etag; private final String friendlyName; - private final String id; + private final String generatedId; private final Long lastModified; private final String location; private final String selfLink; @@ -114,7 +113,7 @@ public abstract static class Builder { */ public abstract Builder friendlyName(String friendlyName); - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); abstract Builder lastModified(Long lastModified); @@ -144,7 +143,7 @@ static final class BuilderImpl extends Builder { private String description; private String etag; private String friendlyName; - private String id; + private String generatedId; private Long lastModified; private String location; private String selfLink; @@ -159,7 +158,7 @@ static final class BuilderImpl extends Builder { this.description = datasetInfo.description; this.etag = datasetInfo.etag; this.friendlyName = datasetInfo.friendlyName; - this.id = datasetInfo.id; + this.generatedId = datasetInfo.generatedId; this.lastModified = datasetInfo.lastModified; this.location = datasetInfo.location; this.selfLink = datasetInfo.selfLink; @@ -182,7 +181,7 @@ public Acl apply(Dataset.Access accessPb) { this.description = datasetPb.getDescription(); this.etag = datasetPb.getEtag(); this.friendlyName = datasetPb.getFriendlyName(); - this.id = datasetPb.getId(); + this.generatedId = datasetPb.getId(); this.lastModified = datasetPb.getLastModifiedTime(); this.location = datasetPb.getLocation(); this.selfLink = datasetPb.getSelfLink(); @@ -232,8 +231,8 @@ public Builder friendlyName(String friendlyName) { } @Override - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -269,7 +268,7 @@ public DatasetInfo build() { description = builder.description; etag = builder.etag; friendlyName = builder.friendlyName; - id = builder.id; + generatedId = builder.generatedId; lastModified = builder.lastModified; location = builder.location; selfLink = builder.selfLink; @@ -333,10 +332,10 @@ public String friendlyName() { } /** - * Returns an opaque id for the dataset. + * Returns the service-generated id for the dataset. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -381,7 +380,7 @@ public String toString() { .add("description", description) .add("etag", etag) .add("friendlyName", friendlyName) - .add("id", id) + .add("generatedId", generatedId) .add("lastModified", lastModified) .add("location", location) .add("selfLink", selfLink) @@ -431,7 +430,7 @@ Dataset toPb() { datasetPb.setDescription(description); datasetPb.setEtag(etag); datasetPb.setFriendlyName(friendlyName); - datasetPb.setId(id); + datasetPb.setId(generatedId); datasetPb.setLastModifiedTime(lastModified); datasetPb.setLocation(location); datasetPb.setSelfLink(selfLink); diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java index 1e63344a600d..586395a0f879 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java @@ -63,8 +63,8 @@ Builder etag(String etag) { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/JobInfo.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/JobInfo.java index 1adf7fabafc1..b15ba38f8912 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/JobInfo.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/JobInfo.java @@ -42,10 +42,10 @@ public JobInfo apply(Job pb) { } }; - private static final long serialVersionUID = -3272941007234620265L; + private static final long serialVersionUID = 2740548743267670124L; private final String etag; - private final String id; + private final String generatedId; private final JobId jobId; private final String selfLink; private final JobStatus status; @@ -95,7 +95,7 @@ public abstract static class Builder { abstract Builder etag(String etag); - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); /** * Sets the job identity. @@ -128,7 +128,7 @@ public abstract static class Builder { static final class BuilderImpl extends Builder { private String etag; - private String id; + private String generatedId; private JobId jobId; private String selfLink; private JobStatus status; @@ -140,7 +140,7 @@ static final class BuilderImpl extends Builder { BuilderImpl(JobInfo jobInfo) { this.etag = jobInfo.etag; - this.id = jobInfo.id; + this.generatedId = jobInfo.generatedId; this.jobId = jobInfo.jobId; this.selfLink = jobInfo.selfLink; this.status = jobInfo.status; @@ -151,7 +151,7 @@ static final class BuilderImpl extends Builder { BuilderImpl(Job jobPb) { this.etag = jobPb.getEtag(); - this.id = jobPb.getId(); + this.generatedId = jobPb.getId(); if (jobPb.getJobReference() != null) { this.jobId = JobId.fromPb(jobPb.getJobReference()); } @@ -173,8 +173,8 @@ Builder etag(String etag) { } @Override - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -223,7 +223,7 @@ public JobInfo build() { JobInfo(BuilderImpl builder) { this.jobId = builder.jobId; this.etag = builder.etag; - this.id = builder.id; + this.generatedId = builder.generatedId; this.selfLink = builder.selfLink; this.status = builder.status; this.statistics = builder.statistics; @@ -239,10 +239,10 @@ public String etag() { } /** - * Returns an opaque id for the job. + * Returns the service-generated id for the job. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -306,7 +306,7 @@ public String toString() { .add("statistics", statistics) .add("userEmail", userEmail) .add("etag", etag) - .add("id", id) + .add("generatedId", generatedId) .add("selfLink", selfLink) .add("configuration", configuration) .toString(); @@ -331,7 +331,7 @@ JobInfo setProjectId(String projectId) { Job toPb() { Job jobPb = new Job(); jobPb.setEtag(etag); - jobPb.setId(id); + jobPb.setId(generatedId); jobPb.setSelfLink(selfLink); jobPb.setUserEmail(userEmail); if (jobId != null) { diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java index 3f902d2ff242..b007771645df 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java @@ -92,8 +92,8 @@ public Builder friendlyName(String friendlyName) { } @Override - Builder id(String id) { - infoBuilder.id(id); + Builder generatedId(String generatedId) { + infoBuilder.generatedId(generatedId); return this; } diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/TableInfo.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/TableInfo.java index de331350e978..938907e245e7 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/TableInfo.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/TableInfo.java @@ -52,10 +52,10 @@ public Table apply(TableInfo tableInfo) { } }; - private static final long serialVersionUID = -7679032506430816205L; + private static final long serialVersionUID = 609769795097719407L; private final String etag; - private final String id; + private final String generatedId; private final String selfLink; private final TableId tableId; private final String friendlyName; @@ -90,7 +90,7 @@ public abstract static class Builder { */ public abstract Builder friendlyName(String friendlyName); - abstract Builder id(String id); + abstract Builder generatedId(String generatedId); abstract Builder lastModifiedTime(Long lastModifiedTime); @@ -117,7 +117,7 @@ public abstract static class Builder { static class BuilderImpl extends Builder { private String etag; - private String id; + private String generatedId; private String selfLink; private TableId tableId; private String friendlyName; @@ -131,7 +131,7 @@ static class BuilderImpl extends Builder { BuilderImpl(TableInfo tableInfo) { this.etag = tableInfo.etag; - this.id = tableInfo.id; + this.generatedId = tableInfo.generatedId; this.selfLink = tableInfo.selfLink; this.tableId = tableInfo.tableId; this.friendlyName = tableInfo.friendlyName; @@ -152,7 +152,7 @@ static class BuilderImpl extends Builder { this.friendlyName = tablePb.getFriendlyName(); this.creationTime = tablePb.getCreationTime(); this.etag = tablePb.getEtag(); - this.id = tablePb.getId(); + this.generatedId = tablePb.getId(); this.selfLink = tablePb.getSelfLink(); this.definition = TableDefinition.fromPb(tablePb); } @@ -188,8 +188,8 @@ public Builder friendlyName(String friendlyName) { } @Override - Builder id(String id) { - this.id = id; + Builder generatedId(String generatedId) { + this.generatedId = generatedId; return this; } @@ -226,7 +226,7 @@ public TableInfo build() { TableInfo(BuilderImpl builder) { this.tableId = checkNotNull(builder.tableId); this.etag = builder.etag; - this.id = builder.id; + this.generatedId = builder.generatedId; this.selfLink = builder.selfLink; this.friendlyName = builder.friendlyName; this.description = builder.description; @@ -244,10 +244,10 @@ public String etag() { } /** - * Returns an opaque id for the table. + * Returns the service-generated id for the table. */ - public String id() { - return id; + public String generatedId() { + return generatedId; } /** @@ -321,7 +321,7 @@ public String toString() { return MoreObjects.toStringHelper(this) .add("tableId", tableId) .add("etag", etag) - .add("id", id) + .add("generatedId", generatedId) .add("selfLink", selfLink) .add("friendlyName", friendlyName) .add("description", description) @@ -379,7 +379,7 @@ Table toPb() { tablePb.setEtag(etag); tablePb.setExpirationTime(expirationTime); tablePb.setFriendlyName(friendlyName); - tablePb.setId(id); + tablePb.setId(generatedId); tablePb.setSelfLink(selfLink); return tablePb; } diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetInfoTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetInfoTest.java index 20875c0fc853..474a31d44a20 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetInfoTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetInfoTest.java @@ -38,7 +38,7 @@ public class DatasetInfoTest { private static final String DESCRIPTION = "description"; private static final String ETAG = "0xFF00"; private static final String FRIENDLY_NAME = "friendlyDataset"; - private static final String ID = "P/D:1"; + private static final String GENERATED_ID = "P/D:1"; private static final Long LAST_MODIFIED = CREATION_TIME + 50; private static final String LOCATION = ""; private static final String SELF_LINK = "http://bigquery/p/d"; @@ -51,7 +51,7 @@ public class DatasetInfoTest { .description(DESCRIPTION) .etag(ETAG) .friendlyName(FRIENDLY_NAME) - .id(ID) + .generatedId(GENERATED_ID) .lastModified(LAST_MODIFIED) .location(LOCATION) .selfLink(SELF_LINK) @@ -90,7 +90,7 @@ public void testBuilder() { assertEquals(DESCRIPTION, DATASET_INFO.description()); assertEquals(ETAG, DATASET_INFO.etag()); assertEquals(FRIENDLY_NAME, DATASET_INFO.friendlyName()); - assertEquals(ID, DATASET_INFO.id()); + assertEquals(GENERATED_ID, DATASET_INFO.generatedId()); assertEquals(LAST_MODIFIED, DATASET_INFO.lastModified()); assertEquals(LOCATION, DATASET_INFO.location()); assertEquals(SELF_LINK, DATASET_INFO.selfLink()); @@ -101,7 +101,7 @@ public void testBuilder() { assertEquals(DESCRIPTION, DATASET_INFO_COMPLETE.description()); assertEquals(ETAG, DATASET_INFO_COMPLETE.etag()); assertEquals(FRIENDLY_NAME, DATASET_INFO_COMPLETE.friendlyName()); - assertEquals(ID, DATASET_INFO_COMPLETE.id()); + assertEquals(GENERATED_ID, DATASET_INFO_COMPLETE.generatedId()); assertEquals(LAST_MODIFIED, DATASET_INFO_COMPLETE.lastModified()); assertEquals(LOCATION, DATASET_INFO_COMPLETE.location()); assertEquals(SELF_LINK, DATASET_INFO_COMPLETE.selfLink()); @@ -125,7 +125,7 @@ private void compareDatasets(DatasetInfo expected, DatasetInfo value) { assertEquals(expected.description(), value.description()); assertEquals(expected.etag(), value.etag()); assertEquals(expected.friendlyName(), value.friendlyName()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.location(), value.location()); assertEquals(expected.selfLink(), value.selfLink()); assertEquals(expected.acl(), value.acl()); diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java index dd03b7899ebc..43c550c59d11 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java @@ -51,7 +51,7 @@ public class DatasetTest { private static final String DESCRIPTION = "description"; private static final String ETAG = "0xFF00"; private static final String FRIENDLY_NAME = "friendlyDataset"; - private static final String ID = "P/D:1"; + private static final String GENERATED_ID = "P/D:1"; private static final Long LAST_MODIFIED = CREATION_TIME + 50; private static final String LOCATION = ""; private static final String SELF_LINK = "http://bigquery/p/d"; @@ -102,7 +102,7 @@ public void testBuilder() { .description(DESCRIPTION) .etag(ETAG) .friendlyName(FRIENDLY_NAME) - .id(ID) + .generatedId(GENERATED_ID) .lastModified(LAST_MODIFIED) .location(LOCATION) .selfLink(SELF_LINK) @@ -114,7 +114,7 @@ public void testBuilder() { assertEquals(DESCRIPTION, builtDataset.description()); assertEquals(ETAG, builtDataset.etag()); assertEquals(FRIENDLY_NAME, builtDataset.friendlyName()); - assertEquals(ID, builtDataset.id()); + assertEquals(GENERATED_ID, builtDataset.generatedId()); assertEquals(LAST_MODIFIED, builtDataset.lastModified()); assertEquals(LOCATION, builtDataset.location()); assertEquals(SELF_LINK, builtDataset.selfLink()); @@ -362,7 +362,7 @@ private void compareDatasetInfo(DatasetInfo expected, DatasetInfo value) { assertEquals(expected.description(), value.description()); assertEquals(expected.etag(), value.etag()); assertEquals(expected.friendlyName(), value.friendlyName()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.location(), value.location()); assertEquals(expected.selfLink(), value.selfLink()); assertEquals(expected.acl(), value.acl()); diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobInfoTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobInfoTest.java index 260088470aff..9c90fbe7b05f 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobInfoTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobInfoTest.java @@ -37,7 +37,7 @@ public class JobInfoTest { private static final String ETAG = "etag"; - private static final String ID = "id"; + private static final String GENERATED_ID = "id"; private static final String SELF_LINK = "selfLink"; private static final String EMAIL = "email"; private static final JobId JOB_ID = JobId.of("job"); @@ -163,7 +163,7 @@ public class JobInfoTest { .statistics(COPY_JOB_STATISTICS) .jobId(JOB_ID) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .selfLink(SELF_LINK) .userEmail(EMAIL) .status(JOB_STATUS) @@ -173,7 +173,7 @@ public class JobInfoTest { .statistics(EXTRACT_JOB_STATISTICS) .jobId(JOB_ID) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .selfLink(SELF_LINK) .userEmail(EMAIL) .status(JOB_STATUS) @@ -183,7 +183,7 @@ public class JobInfoTest { .statistics(LOAD_JOB_STATISTICS) .jobId(JOB_ID) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .selfLink(SELF_LINK) .userEmail(EMAIL) .status(JOB_STATUS) @@ -193,7 +193,7 @@ public class JobInfoTest { .statistics(QUERY_JOB_STATISTICS) .jobId(JOB_ID) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .selfLink(SELF_LINK) .userEmail(EMAIL) .status(JOB_STATUS) @@ -266,7 +266,7 @@ public void testToBuilderIncomplete() { @Test public void testBuilder() { assertEquals(ETAG, COPY_JOB.etag()); - assertEquals(ID, COPY_JOB.id()); + assertEquals(GENERATED_ID, COPY_JOB.generatedId()); assertEquals(SELF_LINK, COPY_JOB.selfLink()); assertEquals(EMAIL, COPY_JOB.userEmail()); assertEquals(JOB_ID, COPY_JOB.jobId()); @@ -275,7 +275,7 @@ public void testBuilder() { assertEquals(COPY_JOB_STATISTICS, COPY_JOB.statistics()); assertEquals(ETAG, EXTRACT_JOB.etag()); - assertEquals(ID, EXTRACT_JOB.id()); + assertEquals(GENERATED_ID, EXTRACT_JOB.generatedId()); assertEquals(SELF_LINK, EXTRACT_JOB.selfLink()); assertEquals(EMAIL, EXTRACT_JOB.userEmail()); assertEquals(JOB_ID, EXTRACT_JOB.jobId()); @@ -284,7 +284,7 @@ public void testBuilder() { assertEquals(EXTRACT_JOB_STATISTICS, EXTRACT_JOB.statistics()); assertEquals(ETAG, LOAD_JOB.etag()); - assertEquals(ID, LOAD_JOB.id()); + assertEquals(GENERATED_ID, LOAD_JOB.generatedId()); assertEquals(SELF_LINK, LOAD_JOB.selfLink()); assertEquals(EMAIL, LOAD_JOB.userEmail()); assertEquals(JOB_ID, LOAD_JOB.jobId()); @@ -293,7 +293,7 @@ public void testBuilder() { assertEquals(LOAD_JOB_STATISTICS, LOAD_JOB.statistics()); assertEquals(ETAG, QUERY_JOB.etag()); - assertEquals(ID, QUERY_JOB.id()); + assertEquals(GENERATED_ID, QUERY_JOB.generatedId()); assertEquals(SELF_LINK, QUERY_JOB.selfLink()); assertEquals(EMAIL, QUERY_JOB.userEmail()); assertEquals(JOB_ID, QUERY_JOB.jobId()); @@ -359,7 +359,7 @@ private void compareJobInfo(JobInfo expected, JobInfo value) { assertEquals(expected.hashCode(), value.hashCode()); assertEquals(expected.toString(), value.toString()); assertEquals(expected.etag(), value.etag()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.jobId(), value.jobId()); assertEquals(expected.selfLink(), value.selfLink()); assertEquals(expected.status(), value.status()); diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java index db51706fff5a..e066bbed2fb4 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java @@ -36,7 +36,7 @@ public class JobTest { private static final TableId TABLE_ID1 = TableId.of("dataset", "table1"); private static final TableId TABLE_ID2 = TableId.of("dataset", "table2"); private static final String ETAG = "etag"; - private static final String ID = "id"; + private static final String GENERATED_ID = "id"; private static final String SELF_LINK = "selfLink"; private static final String EMAIL = "email"; private static final JobStatus JOB_STATUS = new JobStatus(JobStatus.State.DONE); @@ -52,7 +52,7 @@ public class JobTest { .statistics(COPY_JOB_STATISTICS) .jobId(JOB_ID) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .selfLink(SELF_LINK) .userEmail(EMAIL) .status(JOB_STATUS) @@ -89,13 +89,13 @@ public void testBuilder() { .statistics(COPY_JOB_STATISTICS) .jobId(JOB_ID) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .selfLink(SELF_LINK) .userEmail(EMAIL) .status(JOB_STATUS) .build(); assertEquals(ETAG, builtJob.etag()); - assertEquals(ID, builtJob.id()); + assertEquals(GENERATED_ID, builtJob.generatedId()); assertEquals(SELF_LINK, builtJob.selfLink()); assertEquals(EMAIL, builtJob.userEmail()); assertEquals(JOB_ID, builtJob.jobId()); @@ -247,7 +247,7 @@ private void compareJobInfo(JobInfo expected, JobInfo value) { assertEquals(expected.hashCode(), value.hashCode()); assertEquals(expected.toString(), value.toString()); assertEquals(expected.etag(), value.etag()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.jobId(), value.jobId()); assertEquals(expected.selfLink(), value.selfLink()); assertEquals(expected.status(), value.status()); diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/SerializationTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/SerializationTest.java index 111df074ffa2..61e763f9a539 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/SerializationTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/SerializationTest.java @@ -44,7 +44,7 @@ public class SerializationTest extends BaseSerializationTest { private static final String DESCRIPTION = "Description"; private static final String ETAG = "0xFF00"; private static final String FRIENDLY_NAME = "friendlyDataset"; - private static final String ID = "P/D:1"; + private static final String GENERATED_ID = "P/D:1"; private static final Long LAST_MODIFIED = CREATION_TIME + 50; private static final String LOCATION = ""; private static final String SELF_LINK = "http://bigquery/p/d"; @@ -56,7 +56,7 @@ public class SerializationTest extends BaseSerializationTest { .description(DESCRIPTION) .etag(ETAG) .friendlyName(FRIENDLY_NAME) - .id(ID) + .generatedId(GENERATED_ID) .lastModified(LAST_MODIFIED) .location(LOCATION) .selfLink(SELF_LINK) @@ -106,21 +106,21 @@ public class SerializationTest extends BaseSerializationTest { .creationTime(CREATION_TIME) .description(DESCRIPTION) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .build(); private static final TableDefinition VIEW_DEFINITION = ViewDefinition.of("QUERY"); private static final TableInfo VIEW_INFO = TableInfo.builder(TABLE_ID, VIEW_DEFINITION) .creationTime(CREATION_TIME) .description(DESCRIPTION) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .build(); private static final TableInfo EXTERNAL_TABLE_INFO = TableInfo.builder(TABLE_ID, EXTERNAL_TABLE_DEFINITION) .creationTime(CREATION_TIME) .description(DESCRIPTION) .etag(ETAG) - .id(ID) + .generatedId(GENERATED_ID) .build(); private static final JobStatistics JOB_STATISTICS = JobStatistics.builder() .creationTime(1L) diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableInfoTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableInfoTest.java index 18b8be10d71e..84d224f220cb 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableInfoTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableInfoTest.java @@ -27,7 +27,7 @@ public class TableInfoTest { private static final String ETAG = "etag"; - private static final String ID = "project:dataset:table"; + private static final String GENERATED_ID = "project:dataset:table"; private static final String SELF_LINK = "selfLink"; private static final TableId TABLE_ID = TableId.of("dataset", "table"); private static final String FRIENDLY_NAME = "friendlyName"; @@ -89,7 +89,7 @@ public class TableInfoTest { .etag(ETAG) .expirationTime(EXPIRATION_TIME) .friendlyName(FRIENDLY_NAME) - .id(ID) + .generatedId(GENERATED_ID) .lastModifiedTime(LAST_MODIFIED_TIME) .selfLink(SELF_LINK) .build(); @@ -99,7 +99,7 @@ public class TableInfoTest { .etag(ETAG) .expirationTime(EXPIRATION_TIME) .friendlyName(FRIENDLY_NAME) - .id(ID) + .generatedId(GENERATED_ID) .lastModifiedTime(LAST_MODIFIED_TIME) .selfLink(SELF_LINK) .build(); @@ -110,7 +110,7 @@ public class TableInfoTest { .etag(ETAG) .expirationTime(EXPIRATION_TIME) .friendlyName(FRIENDLY_NAME) - .id(ID) + .generatedId(GENERATED_ID) .lastModifiedTime(LAST_MODIFIED_TIME) .selfLink(SELF_LINK) .build(); @@ -148,7 +148,7 @@ public void testBuilder() { assertEquals(ETAG, TABLE_INFO.etag()); assertEquals(EXPIRATION_TIME, TABLE_INFO.expirationTime()); assertEquals(FRIENDLY_NAME, TABLE_INFO.friendlyName()); - assertEquals(ID, TABLE_INFO.id()); + assertEquals(GENERATED_ID, TABLE_INFO.generatedId()); assertEquals(LAST_MODIFIED_TIME, TABLE_INFO.lastModifiedTime()); assertEquals(TABLE_DEFINITION, TABLE_INFO.definition()); assertEquals(SELF_LINK, TABLE_INFO.selfLink()); @@ -159,7 +159,7 @@ public void testBuilder() { assertEquals(ETAG, VIEW_INFO.etag()); assertEquals(EXPIRATION_TIME, VIEW_INFO.expirationTime()); assertEquals(FRIENDLY_NAME, VIEW_INFO.friendlyName()); - assertEquals(ID, VIEW_INFO.id()); + assertEquals(GENERATED_ID, VIEW_INFO.generatedId()); assertEquals(LAST_MODIFIED_TIME, VIEW_INFO.lastModifiedTime()); assertEquals(VIEW_TYPE, VIEW_INFO.definition()); assertEquals(SELF_LINK, VIEW_INFO.selfLink()); @@ -169,7 +169,7 @@ public void testBuilder() { assertEquals(ETAG, EXTERNAL_TABLE_INFO.etag()); assertEquals(EXPIRATION_TIME, EXTERNAL_TABLE_INFO.expirationTime()); assertEquals(FRIENDLY_NAME, EXTERNAL_TABLE_INFO.friendlyName()); - assertEquals(ID, EXTERNAL_TABLE_INFO.id()); + assertEquals(GENERATED_ID, EXTERNAL_TABLE_INFO.generatedId()); assertEquals(LAST_MODIFIED_TIME, EXTERNAL_TABLE_INFO.lastModifiedTime()); assertEquals(EXTERNAL_TABLE_DEFINITION, EXTERNAL_TABLE_INFO.definition()); assertEquals(SELF_LINK, EXTERNAL_TABLE_INFO.selfLink()); @@ -198,7 +198,7 @@ private void compareTableInfo(TableInfo expected, TableInfo value) { assertEquals(expected.etag(), value.etag()); assertEquals(expected.expirationTime(), value.expirationTime()); assertEquals(expected.friendlyName(), value.friendlyName()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.lastModifiedTime(), value.lastModifiedTime()); assertEquals(expected.selfLink(), value.selfLink()); assertEquals(expected.definition(), value.definition()); diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java index c7828ebeadf4..cab71d4705d5 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java @@ -44,7 +44,7 @@ public class TableTest { private static final String ETAG = "etag"; - private static final String ID = "project:dataset:table1"; + private static final String GENERATED_ID = "project:dataset:table1"; private static final String SELF_LINK = "selfLink"; private static final String FRIENDLY_NAME = "friendlyName"; private static final String DESCRIPTION = "description"; @@ -115,7 +115,7 @@ public void testBuilder() { .etag(ETAG) .expirationTime(EXPIRATION_TIME) .friendlyName(FRIENDLY_NAME) - .id(ID) + .generatedId(GENERATED_ID) .lastModifiedTime(LAST_MODIFIED_TIME) .selfLink(SELF_LINK) .build(); @@ -125,7 +125,7 @@ public void testBuilder() { assertEquals(ETAG, builtTable.etag()); assertEquals(EXPIRATION_TIME, builtTable.expirationTime()); assertEquals(FRIENDLY_NAME, builtTable.friendlyName()); - assertEquals(ID, builtTable.id()); + assertEquals(GENERATED_ID, builtTable.generatedId()); assertEquals(LAST_MODIFIED_TIME, builtTable.lastModifiedTime()); assertEquals(TABLE_DEFINITION, builtTable.definition()); assertEquals(SELF_LINK, builtTable.selfLink()); @@ -398,7 +398,7 @@ private void compareTableInfo(TableInfo expected, TableInfo value) { assertEquals(expected.etag(), value.etag()); assertEquals(expected.expirationTime(), value.expirationTime()); assertEquals(expected.friendlyName(), value.friendlyName()); - assertEquals(expected.id(), value.id()); + assertEquals(expected.generatedId(), value.generatedId()); assertEquals(expected.lastModifiedTime(), value.lastModifiedTime()); assertEquals(expected.selfLink(), value.selfLink()); assertEquals(expected.definition(), value.definition()); diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/it/ITBigQueryTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/it/ITBigQueryTest.java index 50780b4fc9a9..e712eeeb23fd 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/it/ITBigQueryTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/it/ITBigQueryTest.java @@ -214,7 +214,7 @@ public void testGetDataset() { assertEquals(DESCRIPTION, dataset.description()); assertNotNull(dataset.acl()); assertNotNull(dataset.etag()); - assertNotNull(dataset.id()); + assertNotNull(dataset.generatedId()); assertNotNull(dataset.lastModified()); assertNotNull(dataset.selfLink()); } @@ -231,7 +231,7 @@ public void testGetDatasetWithSelectedFields() { assertNull(dataset.acl()); assertNull(dataset.etag()); assertNull(dataset.friendlyName()); - assertNull(dataset.id()); + assertNull(dataset.generatedId()); assertNull(dataset.lastModified()); assertNull(dataset.location()); assertNull(dataset.selfLink()); @@ -270,7 +270,7 @@ public void testUpdateDatasetWithSelectedFields() { assertNull(updatedDataset.acl()); assertNull(updatedDataset.etag()); assertNull(updatedDataset.friendlyName()); - assertNull(updatedDataset.id()); + assertNull(updatedDataset.generatedId()); assertNull(updatedDataset.lastModified()); assertNull(updatedDataset.location()); assertNull(updatedDataset.selfLink()); @@ -697,7 +697,7 @@ public void testListJobs() { assertNotNull(job.statistics()); assertNotNull(job.status()); assertNotNull(job.userEmail()); - assertNotNull(job.id()); + assertNotNull(job.generatedId()); } } @@ -709,7 +709,7 @@ public void testListJobsWithSelectedFields() { assertNotNull(job.status()); assertNotNull(job.userEmail()); assertNull(job.statistics()); - assertNull(job.id()); + assertNull(job.generatedId()); } }