Skip to content

Commit e22f679

Browse files
committed
Fixed missing guava dependecies which where previously build into espresso-core.aar
1 parent 983de86 commit e22f679

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

testrunner/AndroidJunitRunnerSample/app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ android {
2929
dependencies {
3030
// App's dependencies, including test
3131
compile 'com.android.support:support-annotations:21.0.3'
32+
compile 'com.google.guava:guava:18.0'
3233

3334
// Testing-only dependencies
3435
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'

testrunner/AndroidJunitRunnerSample/app/src/main/java/com/example/android/testing/androidjunitrunnersample/Calculator.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package com.example.android.testing.androidjunitrunnersample;
1818

19+
import static com.google.common.base.Preconditions.checkArgument;
20+
1921
/**
2022
* A simple calculator with a basic set of operations.
2123
*/
@@ -41,9 +43,7 @@ public double sub(double firstOperand, double secondOperand) {
4143
* Divide operation
4244
*/
4345
public double div(double firstOperand, double secondOperand) {
44-
if (secondOperand == 0) {
45-
throw new IllegalArgumentException("secondOperand must be != 0, you cannot divide by zero");
46-
}
46+
checkArgument(secondOperand != 0, "secondOperand must be != 0, you cannot divide by zero");
4747
return firstOperand / secondOperand;
4848
}
4949

0 commit comments

Comments
 (0)