question stringlengths 935 50.2k | answer stringlengths 92 8.26k |
|---|---|
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'combineResultSets' in class 'com.google.api.ads.admanager.jaxw... | ```java
@Test(expected = IllegalArgumentException.class)
public void testCombineResultSet_badColumns() {
Row row1 = new Row();
row1.getValues().addAll(Lists.newArrayList(textValue1, booleanValue1, numberValue1));
Row row2 = new Row();
row2.getValues().addAll(Lists.newArrayList(textValue2, booleanValue2,... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'toString' in class 'com.google.api.ads.admanager.jaxws.utils.v... | ```java
@Test(expected = IllegalArgumentException.class)
public void testToString_invalidValue() {
Pql.toString(new MyValue());
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getApiValue' in class 'com.google.api.ads.admanager.jaxws.util... | ```java
@Test(expected = IllegalArgumentException.class)
public void testGetApiValue_mixedSet() {
Pql.getApiValue(mixedSetValue);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getNativeValue' in class 'com.google.api.ads.admanager.jaxws.u... | ```java
@Test(expected = IllegalArgumentException.class)
public void testGetNativeValue_mixedSet() {
Pql.getNativeValue(mixedSetValue);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getCsvValue' in class 'com.google.api.ads.admanager.jaxws.util... | ```java
@Test(expected = IllegalArgumentException.class)
public void testGetCsvValue_mixedSet() {
Pql.getCsvValue(mixedSetValue);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getCsvValue' in class 'com.google.api.ads.admanager.jaxws.util... | ```java
@Test(expected = IllegalArgumentException.class)
public void testGetCsvValue_targetingValue() {
Pql.getCsvValue(targetingValue1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createValue' in class 'com.google.api.ads.admanager.jaxws.util... | ```java
@Test(expected = IllegalArgumentException.class)
public void testCreateValue_invalidType() {
Pql.createValue(new MyObject());
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createValue' in class 'com.google.api.ads.admanager.jaxws.util... | ```java
@Test(expected = IllegalArgumentException.class)
public void testCreateValue_mixedSet() {
Set<Object> mixedTypeSet = new LinkedHashSet<Object>();
mixedTypeSet.add(dateTime1);
mixedTypeSet.add("value1");
Pql.createValue(mixedTypeSet);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createValue' in class 'com.google.api.ads.admanager.jaxws.util... | ```java
@Test(expected = IllegalArgumentException.class)
public void testCreateValue_nestedSets() {
Set<Object> set = new LinkedHashSet<Object>();
Set<Object> innerSet = new LinkedHashSet<Object>();
set.add(innerSet);
Pql.createValue(set);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'combineResultSets' in class 'com.google.api.ads.admanager.jaxw... | ```java
@Test(expected = IllegalArgumentException.class)
public void testCombineResultSet_badColumns() {
Row row1 = new Row();
row1.getValues().addAll(Lists.newArrayList(textValue1, booleanValue1, numberValue1));
Row row2 = new Row();
row2.getValues().addAll(Lists.newArrayList(textValue2, booleanValue2,... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.jaxws.utils.v2018... | ```java
@Test(expected = NullPointerException.class)
public void testBuildWithCopyConstructor_nullArg_fails() {
new ServiceQuery.Builder(null).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.jaxws.utils.v20180... | ```java
@Test(expected = IllegalStateException.class)
public void testBuild_fails_fieldsNotCalled() {
new ServiceQuery.Builder().build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.jaxws.utils.v20180... | ```java
@Test(expected = IllegalStateException.class)
public void testBuild_fails_limitNotCalled() {
new ServiceQuery.Builder().fields("Id").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'limit' in class 'com.google.api.ads.adwords.jaxws.utils.v20180... | ```java
@Test(expected = IllegalArgumentException.class)
public void testBuild_fails_limitCalledWithZeroPageSize() {
new ServiceQuery.Builder().fields("Id").limit(0, 0).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'addChild' in class 'com.google.api.ads.adwords.axis.utils.v201... | ```java
@Test(expected = IllegalArgumentException.class)
public void testAddChildToUnit_fails() {
assertTrue("root should be a unit by default", rootNode.isUnit());
rootNode.addChild(ProductDimensions.createBrand("google"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'asExcludedUnit' in class 'com.google.api.ads.adwords.axis.util... | ```java
@Test(expected = IllegalStateException.class)
public void testCreateExcludedRoot_fails() {
rootNode.asExcludedUnit();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getChild' in class 'com.google.api.ads.adwords.axis.utils.v201... | ```java
@Test(expected = IllegalArgumentException.class)
public void testGetChildThatDoesNotExist_fails() {
rootNode = rootNode.asSubdivision();
rootNode.getChild(ProductDimensions.createBrand("google"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'removeChild' in class 'com.google.api.ads.adwords.axis.utils.v... | ```java
@Test(expected = IllegalArgumentException.class)
public void testRemoveChildThatDoesNotExist_fails() {
rootNode = rootNode.asSubdivision();
rootNode.removeChild(ProductDimensions.createBrand("google"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'addChild' in class 'com.google.api.ads.adwords.axis.utils.v201... | ```java
@Test(expected = IllegalArgumentException.class)
public void testAddChildThatExists_fails() {
rootNode = rootNode.asSubdivision();
rootNode.addChild(ProductDimensions.createBrand("google"));
rootNode.addChild(ProductDimensions.createBrand("google"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'setBid' in class 'com.google.api.ads.adwords.axis.utils.v20180... | ```java
@Test(expected = IllegalStateException.class)
public void testSetBidOnSubdivision_fails() {
rootNode = rootNode.asSubdivision();
rootNode.setBid(1L);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'setTrackingUrlTemplate' in class 'com.google.api.ads.adwords.a... | ```java
@Test(expected = IllegalStateException.class)
public void testSetTrackingUrlTemplateOnSubdivision_fails() {
rootNode = rootNode.asSubdivision();
rootNode.setTrackingUrlTemplate("http://www.example.com/tracking?{lpurl}");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'setTrackingUrlTemplate' in class 'com.google.api.ads.adwords.a... | ```java
@Test(expected = IllegalStateException.class)
public void testSetTrackingUrlTemplateOnExcludedUnit_fails() {
rootNode = rootNode.asSubdivision();
ProductBrand childDimension = ProductDimensions.createBrand("google");
ProductPartitionNode excludedUnitNode = rootNode.addChild(childDimension).asExclude... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'putCustomParameter' in class 'com.google.api.ads.adwords.axis.... | ```java
@Test(expected = IllegalStateException.class)
public void testPutCustomParametersOnSubdivision_fails() {
rootNode = rootNode.asSubdivision();
rootNode.putCustomParameter("param", "value");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'putCustomParameter' in class 'com.google.api.ads.adwords.axis.... | ```java
@Test(expected = IllegalStateException.class)
public void testPutCustomParametersOnExcludedUnit_fails() {
rootNode = rootNode.asSubdivision();
ProductBrand childDimension = ProductDimensions.createBrand("google");
ProductPartitionNode excludedUnitNode = rootNode.addChild(childDimension).asExcludedUn... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'setBid' in class 'com.google.api.ads.adwords.axis.utils.v20180... | ```java
@Test(expected = IllegalArgumentException.class)
public void testSetNegativeBid_fails() {
assertTrue("root should be a unit by default", rootNode.isUnit());
rootNode.setBid(-1L);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createType' in class 'com.google.api.ads.adwords.axis.utils.v2... | ```java
@Test(expected = NullPointerException.class)
public void testCreateType_nullTypeLevel_fails() {
ProductDimensions.createType(null, STRING_VALUE);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createBiddingCategory' in class 'com.google.api.ads.adwords.ax... | ```java
@Test(expected = NullPointerException.class)
public void testCreateBiddingCategory_nullCategoryLevel_fails() {
ProductDimensions.createBiddingCategory(null, 1L);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createCustomAttribute' in class 'com.google.api.ads.adwords.ax... | ```java
@Test(expected = NullPointerException.class)
public void testCreateCustomAttribute_nullAttributeLevel_fails() {
ProductDimensions.createCustomAttribute(null, STRING_VALUE);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createCriterionForSetBiddableUnit' in class 'com.google.api.ad... | ```java
@Test(expected = IllegalArgumentException.class)
public void testCreateCriterionForSetBid_excludedNode_fails() {
childNode = childNode.asExcludedUnit();
ProductPartitionNodeAdapter.createCriterionForSetBiddableUnit(childNode, adGroupId, biddingConfig);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'diff' in class 'com.google.api.ads.adwords.axis.utils.v201809.... | ```java
@Test(expected = IllegalArgumentException.class)
public void testFindNodeDifference_differentDimensionTypes_fails() {
ProductPartitionNode origNode = new ProductPartitionNode(null, ProductDimensions.createBrand("nike"), -1L, dimensionComparator);
ProductPartitionNode newNode = new ProductPartitionNode(n... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'diff' in class 'com.google.api.ads.adwords.axis.utils.v201809.... | ```java
@Test(expected = IllegalArgumentException.class)
public void testFindNodeDifference_differentDimensionTypes_origNullDimension_fails() {
ProductPartitionNode origNode = new ProductPartitionNode(null, null, -1L, dimensionComparator);
ProductPartitionNode newNode = new ProductPartitionNode(null, ProductDim... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'diff' in class 'com.google.api.ads.adwords.axis.utils.v201809.... | ```java
@Test(expected = IllegalArgumentException.class)
public void testFindNodeDifference_differentDimensionTypes_newNullDimension_fails() {
ProductPartitionNode origNode = new ProductPartitionNode(null, ProductDimensions.createOfferId("1234"), -1L, dimensionComparator);
ProductPartitionNode newNode = new Pro... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.axis.utils.v20180... | ```java
@Test(expected = NullPointerException.class)
public void testBuildWithCopyConstructor_nullArg_fails() {
new ServiceQuery.Builder(null).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.axis.utils.v201809... | ```java
@Test(expected = IllegalStateException.class)
public void testBuild_fails_fieldsNotCalled() {
new ServiceQuery.Builder().build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.axis.utils.v201809... | ```java
@Test(expected = IllegalStateException.class)
public void testBuild_fails_limitNotCalled() {
new ServiceQuery.Builder().fields("Id").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'limit' in class 'com.google.api.ads.adwords.axis.utils.v201809... | ```java
@Test(expected = IllegalArgumentException.class)
public void testBuild_fails_limitCalledWithZeroPageSize() {
new ServiceQuery.Builder().fields("Id").limit(0, 0).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'deserializeBatchJobMutateResults' in class 'com.google.api.ads... | ```java
@Test(expected = XMLStreamException.class)
public void testDeserializeEmptyBatchJobResponse() throws Exception {
File emptyFile = tempFolder.newFile("empty.xml");
testDeserializeBatchJobResponse(emptyFile.toURI().toURL());
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'addUtility' in class 'com.google.api.ads.common.lib.utils.AdsU... | ```java
@Test(expected = NullPointerException.class)
public void testAddNull_fails() {
AdsUtilityRegistry registry = AdsUtilityRegistry.getInstance();
registry.addUtility(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'extractNode' in class 'com.google.api.ads.common.lib.utils.Nod... | ```java
@Test(expected = NullPointerException.class)
public void testNullXPaths_fails() {
nodeExtractor.extractNode(null, null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testGoogleSecretsReadPropertiesFromConfiguration_missingClientId() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientSecret", "clientSecret");
new GoogleClientSecretsBuild... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testGoogleSecretsReadPropertiesFromConfiguration_missingClientSecret() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
new GoogleClientSecretsBuilder()... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_clientIdTokenBadWithFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientSecret", "clientSecret");
config.setProperty("api.admanager.ref... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_clientIdNoFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientSecret", "clientSecret");
config.setProperty("api.admanager.refreshToken"... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_clientSecretTokenBadWithFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.refresh... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_clientSecretNoFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.refreshToken", "r... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testBuilder_defaultClientIdAndSecret() throws Exception {
new GoogleClientSecretsBuilder().forApi(GoogleClientSecretsBuilder.Api.AD_MANAGER).withClientSecrets("INSERT_CLIENT_ID_HERE", "INSERT_CLIENT_SECRET_HERE").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_defaultClientId() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "INSERT_CLIENT_ID_HERE");
GoogleClientSecretsForApiBuilder builder = ne... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.GoogleClie... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_defaultClientSecret() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.clientId", "INSERT_C... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_missingClientId() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientSecret", "clientSecret");
config.setProperty("api.admanager.refresh... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_missingClientSecret() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.refreshToke... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_missingRefreshToken() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.clientSecre... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_multipleOAuthTypes() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientSecret", "clientSecret");
config.setProperty("api.admanager.json... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_serviceAccountUserNoKeyFile() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.cli... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_refreshTokenBadWithFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.clientSecret... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_refreshTokenNoFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.clientSecret", "c... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_clientIdTokenBadWithFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientSecret", "clientSecret");
config.setProperty("api.admanager.ref... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_clientIdNoFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientSecret", "clientSecret");
config.setProperty("api.admanager.refreshToken"... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_clientSecretTokenBadWithFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.refresh... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.common.lib.auth.OfflineCre... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromFile_clientSecretNoFilePath() throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.clientId", "clientId");
config.setProperty("api.admanager.refreshToken", "r... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'generateCredential' in class 'com.google.api.ads.common.lib.au... | ```java
@Test(expected = OAuthException.class)
public void testGenerateCredential_IOException() throws Exception {
OfflineCredentials offlineCredentials = new OfflineCredentials.Builder(oAuth2Helper).forApi(OfflineCredentials.Api.AD_MANAGER).withClientSecrets("clientId", "clientSecret").withRefreshToken("refreshTok... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'generateCredential' in class 'com.google.api.ads.common.lib.au... | ```java
@Test(expected = OAuthException.class)
public void testGenerateCredential_cantRefresh() throws Exception {
OfflineCredentials offlineCredentials = new OfflineCredentials.Builder(oAuth2Helper).forApi(OfflineCredentials.Api.AD_MANAGER).withClientSecrets("clientId", "clientSecret").withRefreshToken("refreshTok... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'refreshCredential' in class 'com.google.api.ads.common.lib.aut... | ```java
@Test(expected = IOException.class)
public void testRefreshCredential_refreshFailedException() throws Exception {
credential.setAccessToken(ACCESS_TOKEN);
credential.setRefreshToken(REFRESH_TOKEN);
credential.setExpiresInSeconds(REFRESH_WINDOW_SECS - 10L);
Mockito.doThrow(new IOException("Failed... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getSoapClientMethod' in class 'com.google.api.ads.common.lib.s... | ```java
@Test(expected = NoSuchMethodException.class)
public void testGetSoapClientMethod_noMethod() throws Exception {
soapClientHandler.getSoapClientMethod(soapClient, SimilarMockSoapClient.class.getMethod("noSuchMethod", Object[].class, Object.class, Object.class));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getSoapClientMethod' in class 'com.google.api.ads.common.lib.s... | ```java
@Test(expected = NoSuchMethodException.class)
public void testGetSoapClientMethod_incorrectReturnType() throws Exception {
soapClientHandler.getSoapClientMethod(soapClient, SimilarMockSoapClient.class.getMethod("voidCall", Object[].class));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMessage' in class 'com.google.api.ads.common.lib.soap.Req... | ```java
@Test(expected = NullPointerException.class)
public void testParseWithNullBuilder_fails() {
xPathSet.parseMessage((Builder) null, Mockito.mock(SOAPMessage.class));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMessage' in class 'com.google.api.ads.common.lib.soap.Res... | ```java
@Test(expected = NullPointerException.class)
public void testParseWithNullBuilder_fails() {
xPathSet.parseMessage((Builder) null, Mockito.mock(SOAPMessage.class));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.common.lib.conf.Configura... | ```java
@Test(expected = IllegalArgumentException.class)
public void testUnsupportedConfigurationInfo() {
new ConfigurationInfo<Long>(1234L, false);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'newList' in class 'com.google.api.ads.common.lib.conf.Configur... | ```java
@Test(expected = IllegalArgumentException.class)
public void testNewConfigurationInfoList_nullArguments() throws Exception {
ConfigurationHelper.newList(true, (Object[]) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'fromFile' in class 'com.google.api.ads.common.lib.conf.Configu... | ```java
@Test(expected = ConfigurationLoadException.class)
public void testFromFile_stringDoesNotExist() throws Exception {
configurationHelper.fromFile("/" + System.currentTimeMillis());
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'fromFile' in class 'com.google.api.ads.common.lib.conf.Configu... | ```java
@Test(expected = ConfigurationLoadException.class)
public void testFromFile_urlDoesNotExist() throws Exception {
configurationHelper.fromFile(new URL("file:///" + System.currentTimeMillis()));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createCombinedConfiguration' in class 'com.google.api.ads.comm... | ```java
@Test(expected = ConfigurationLoadException.class)
@SuppressWarnings("unchecked")
public void testCreateCombinedConfiguration_requiredUrlNotFound() throws Exception {
test1Properties.forEach(System::setProperty);
System.setProperty("testProperty", "testValue");
configurationHelper.createCombinedConf... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'select' in class 'com.google.api.ads.admanager.lib.utils.Query... | ```java
@Test(expected = NullPointerException.class)
public void testSelect_null() {
QueryBuilder<Object> builder = new QueryBuilder<Object>();
builder.select(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'from' in class 'com.google.api.ads.admanager.lib.utils.QueryBu... | ```java
@Test(expected = NullPointerException.class)
public void testFrom_null() {
QueryBuilder<Object> builder = new QueryBuilder<Object>();
builder.from(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'where' in class 'com.google.api.ads.admanager.lib.utils.QueryB... | ```java
@Test(expected = NullPointerException.class)
public void testWhere_null() {
QueryBuilder<Object> builder = new QueryBuilder<Object>();
builder.where(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'orderBy' in class 'com.google.api.ads.admanager.lib.utils.Quer... | ```java
@Test(expected = NullPointerException.class)
public void testOrderBy_null() {
QueryBuilder<Object> builder = new QueryBuilder<Object>();
builder.orderBy(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'buildQuery' in class 'com.google.api.ads.admanager.lib.utils.Q... | ```java
@Test(expected = IllegalStateException.class)
public void testBuildQuery_OffsetWithoutLimit() {
QueryBuilder<Object> builder = new QueryBuilder<Object>().offset(500);
builder.buildQuery();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.admanager.lib.client.AdMan... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_badEndpoint() throws ValidationException {
String badEndpoint = "3efsdafasd";
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.email", "email");
config.set... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.admanager.lib.client.AdMan... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_noApplicationName() throws ValidationException {
PropertiesConfiguration config = new PropertiesConfiguration();
build(new AdManagerSession.Builder().from(config).withOAuth2Credential(credential));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.admanager.lib.client.AdMan... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_defaultApplicationName() throws ValidationException {
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.admanager.applicationName", "INSERT_APPLICATION_NAME_HERE");
build... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.admanager.lib.client.AdMan... | ```java
@Test(expected = ValidationException.class)
public void testBuilder_noAuths() throws Exception {
build(new AdManagerSession.Builder().withApplicationName("FooBar").withEndpoint("https://ads.google.com").withNetworkCode("networkCode"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.admanager.lib.client.AdMan... | ```java
@Test(expected = ValidationException.class)
public void testBuilder_noApplicationName() throws Exception {
build(new AdManagerSession.Builder().withEndpoint("https://ads.google.com").withNetworkCode("networkCode").withOAuth2Credential(credential));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.admanager.lib.client.AdMan... | ```java
@Test(expected = ValidationException.class)
public void testBuilder_defaultApplicationName() throws Exception {
build(new AdManagerSession.Builder().withEndpoint("https://ads.google.com").withNetworkCode("networkCode").withOAuth2Credential(credential).withApplicationName("INSERT_APPLICATION_NAME_HERE"));
}
... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.admanager.lib.client.AdMan... | ```java
@Test(expected = ValidationException.class)
public void testBuilder_whitespaceApplicationName() throws Exception {
build(new AdManagerSession.Builder().withEndpoint("https://ads.google.com").withNetworkCode("networkCode").withOAuth2Credential(credential).withApplicationName(" "));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'constructContentRangeHeaderValue' in class 'com.google.api.ads... | ```java
@Test(expected = IllegalArgumentException.class)
public void testConstructContentRangeHeaderValue_notLast_zeroLength() {
BatchJobUploadStatus status = new BatchJobUploadStatus(0, null);
uploader.constructContentRangeHeaderValue(0, false, status);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.lib.utils.ReportD... | ```java
@Test(expected = IllegalArgumentException.class)
public void testFailedResponse_fails() {
RawReportDownloadResponse rawResponse = new RawReportDownloadResponse(HttpURLConnection.HTTP_BAD_REQUEST, new ByteArrayInputStream("failed".getBytes(UTF_8)), UTF_8, "CSV");
new ReportDownloadResponse(rawResponse);
... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.lib.utils.v201809... | ```java
@Test(expected = NullPointerException.class)
public void testConstructor_nullArgs_fails() {
new AwqlReportRequest(null, null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.lib.utils.v201809... | ```java
@Test(expected = NullPointerException.class)
public void testConstructor_nullQuery_fails() {
new AwqlReportRequest(null, DownloadFormat.CSV);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.lib.utils.v201809... | ```java
@Test(expected = NullPointerException.class)
public void testConstructor_nullFormat_fails() {
new AwqlReportRequest("SELECT foo, bar", null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.lib.utils.v201809... | ```java
@Test(expected = NullPointerException.class)
public void testConstructor_nullArgs_fails() {
new XmlReportDefinitionRequest(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.lib.utils.v201809... | ```java
@Test(expected = NullPointerException.class)
public void testBuildWithCopyConstructor_nullArg_fails() {
new ReportQuery.Builder(null).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.lib.utils.v201809.... | ```java
@Test(expected = IllegalStateException.class)
public void testBuild_fails_fieldsNotCalled() {
new ReportQuery.Builder().from(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.lib.utils.v201809.... | ```java
@Test(expected = IllegalStateException.class)
public void testBuild_fails_fromNotCalled() {
new ReportQuery.Builder().fields("Id").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'downloadReport' in class 'com.google.api.ads.adwords.lib.utils... | ```java
@Test(expected = ReportDownloadResponseException.class)
public void testFailure_cannotReadStream() throws Exception {
InputStream stream = Mockito.mock(InputStream.class);
when(stream.read(isA(byte[].class))).thenThrow(new IOException());
RawReportDownloadResponse rawResponse = new RawReportDownload... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'downloadReport' in class 'com.google.api.ads.adwords.lib.utils... | ```java
@Test(expected = DetailedReportDownloadResponseException.class)
public void testFailure_failedStatusCode() throws Exception {
InputStream stream = new ByteArrayInputStream(ERROR_TEXT.getBytes(AdHocReportDownloadHelper.REPORT_CHARSET));
int statusCode = 400;
RawReportDownloadResponse rawResponse = ne... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.lib.utils.BatchJo... | ```java
@Test(expected = IllegalArgumentException.class)
public void testInvalidContentLength_fails() {
new BatchJobUploadStatus(-1L, URI.create("http://www.example.com"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'validate' in class 'com.google.api.ads.adwords.lib.client.repo... | ```java
@Test(expected = IllegalArgumentException.class)
public void testValidate_negativeTimeout_fails() {
ReportingConfiguration config = new Builder().skipReportHeader(true).skipColumnHeader(true).reportDownloadTimeout(-1).build();
config.validate(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.lib.client.AdWords... | ```java
@Test(expected = ValidationException.class)
public void testReadPropertiesFromConfiguration_badEndpoint() throws ValidationException {
String badEndpoint = "3efsdafasd";
PropertiesConfiguration config = new PropertiesConfiguration();
config.setProperty("api.adwords.clientCustomerId", "1234567890");
... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.lib.client.AdWords... | ```java
@Test(expected = ValidationException.class)
public void testBuilder_noAuths() throws Exception {
build(new AdWordsSession.Builder().withUserAgent("FooBar").withEndpoint("https://www.google.com").withDeveloperToken("developerToken"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.google.api.ads.adwords.lib.client.AdWords... | ```java
@Test(expected = ValidationException.class)
public void testBuilder_nonAsciiUserAgent() throws Exception {
String nonAsciiUserAgent = "スーパー";
build(new AdWordsSession.Builder().withOAuth2Credential(credential).withUserAgent(nonAsciiUserAgent).withEndpoint("https://www.google.com").withDeveloperToken("de... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'com.google.api.ads.adwords.lib.AdWordsPlugin... | ```java
@Test(expected = NullPointerException.class)
public void testConstructor_nullProvider_fails() {
new AdWordsPluginModule(null);
}
```
</s> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.