File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
translate/src/test/java/com/google/cloud/translate/samples Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,7 @@ public class TranslateTextTest {
8181 Double confidence = Double .parseDouble (
8282 got .split ("confidence=" )[1 ].split ("}" )[0 ]
8383 );
84- assertThat (confidence ).isLessThan (1.0 );
85- assertThat (confidence ).isGreaterThan (0.7 );
84+ assertThat (confidence ).isWithin (0.7 ).of (1.0 );
8685 }
8786
8887 @ Test public void testGermanLangDetection () throws Exception {
@@ -101,8 +100,7 @@ public class TranslateTextTest {
101100 Double confidence = Double .parseDouble (
102101 got .split ("confidence=" )[1 ].split ("}" )[0 ]
103102 );
104- assertThat (confidence ).isLessThan (1.0 );
105- assertThat (confidence ).isGreaterThan (0.9 );
103+ assertThat (confidence ).isWithin (0.9 ).of (1.0 );
106104 }
107105
108106 @ Test public void testDefaultIdentityTranslation () throws Exception {
You can’t perform that action at this time.
0 commit comments