Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions google-cloud-bigquery/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://mojo.codehaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<difference>
<className>com/google/cloud/bigquery/BigQuery</className>
<method>boolean delete(java.lang.String, java.lang.String)</method>
<differenceType>7002</differenceType>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -850,18 +850,6 @@ public int hashCode() {
*/
boolean delete(DatasetId datasetId, DatasetDeleteOption... options);

/**
* Deletes the requested table.
*
* @deprecated Now that BigQuery datasets contain multiple resource types, this invocation is
* ambiguous. Please use more strongly typed version of {@code #delete} that leverages an
* non-ambiguous resource type identifier such as {@code TableId}.
* @return {@code true} if table was deleted, {@code false} if it was not found
* @throws BigQueryException upon failure
*/
@Deprecated
boolean delete(String datasetId, String tableId);

/**
* Deletes the requested table.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,6 @@ public Boolean call() {
}
}

@Override
public boolean delete(String datasetId, String tableId) {
return delete(TableId.of(datasetId, tableId));
}

@Override
public boolean delete(TableId tableId) {
final TableId completeTableId =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import static org.junit.Assert.assertNull;

import com.google.cloud.bigquery.spi.v2.BigQueryRpc;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

public class OptionTest {

Expand All @@ -36,8 +34,6 @@ public class OptionTest {
private static final Option OPTION_NOT_EQUALS1 = new Option(RPC_OPTION, OTHER_VALUE) {};
private static final Option OPTION_NOT_EQUALS2 = new Option(ANOTHER_RPC_OPTION, VALUE) {};

@Rule public ExpectedException thrown = ExpectedException.none();

@Test
public void testEquals() {
assertEquals(OPTION, OPTION_EQUALS);
Expand All @@ -50,14 +46,13 @@ public void testHashCode() {
assertEquals(OPTION.hashCode(), OPTION_EQUALS.hashCode());
}

@Test
@Test(expected = NullPointerException.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Google best practice is not to use expected exceptions. As of JUnit 4.13 you can use assertThrows instead.

public void testConstructor() {
assertEquals(RPC_OPTION, OPTION.getRpcOption());
assertEquals(VALUE, OPTION.getValue());
Option option = new Option(RPC_OPTION, null) {};
assertEquals(RPC_OPTION, option.getRpcOption());
assertNull(option.getValue());
thrown.expect(NullPointerException.class);
new Option(null, VALUE) {};
}
}