File tree 1 file changed +2
-4
lines changed
translate/src/test/java/com/google/cloud/translate/samples
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,7 @@ public class TranslateTextTest {
81
81
Double confidence = Double .parseDouble (
82
82
got .split ("confidence=" )[1 ].split ("}" )[0 ]
83
83
);
84
- assertThat (confidence ).isLessThan (1.0 );
85
- assertThat (confidence ).isGreaterThan (0.7 );
84
+ assertThat (confidence ).isWithin (0.7 ).of (1.0 );
86
85
}
87
86
88
87
@ Test public void testGermanLangDetection () throws Exception {
@@ -101,8 +100,7 @@ public class TranslateTextTest {
101
100
Double confidence = Double .parseDouble (
102
101
got .split ("confidence=" )[1 ].split ("}" )[0 ]
103
102
);
104
- assertThat (confidence ).isLessThan (1.0 );
105
- assertThat (confidence ).isGreaterThan (0.9 );
103
+ assertThat (confidence ).isWithin (0.9 ).of (1.0 );
106
104
}
107
105
108
106
@ Test public void testDefaultIdentityTranslation () throws Exception {
You can’t perform that action at this time.
0 commit comments