1212import org .junit .jupiter .api .condition .EnabledIf ;
1313import org .junit .jupiter .params .ParameterizedTest ;
1414import org .junit .jupiter .params .provider .Arguments ;
15- import org .junit .jupiter .params .provider .CsvSource ;
1615import org .junit .jupiter .params .provider .MethodSource ;
16+ import org .junit .jupiter .params .provider .ValueSource ;
1717import org .mockito .MockedConstruction ;
1818import org .mockito .Mockito ;
1919
@@ -60,13 +60,8 @@ void testExampleTranslation() throws DeepLException, InterruptedException {
6060 }
6161
6262 @ ParameterizedTest
63- @ CsvSource ({
64- "quality_optimized,quality_optimized" ,
65- "prefer_quality_optimized,quality_optimized" ,
66- "latency_optimized,latency_optimized"
67- })
68- void testModelType (String modelTypeArg , String expectedModelType )
69- throws DeepLException , InterruptedException {
63+ @ ValueSource (strings = {"quality_optimized" , "prefer_quality_optimized" , "latency_optimized" })
64+ void testModelType (String modelTypeArg ) throws DeepLException , InterruptedException {
7065 Translator translator = createTranslator ();
7166 String sourceLang = "de" ;
7267 TextResult result =
@@ -75,7 +70,7 @@ void testModelType(String modelTypeArg, String expectedModelType)
7570 sourceLang ,
7671 "en-US" ,
7772 new TextTranslationOptions ().setModelType (modelTypeArg ));
78- Assertions .assertEquals ( expectedModelType , result .getModelTypeUsed ());
73+ Assertions .assertNotNull ( result .getModelTypeUsed ());
7974 }
8075
8176 @ Test
@@ -97,7 +92,9 @@ void testMixedDirectionText() throws DeepLException, InterruptedException {
9792 new TextTranslationOptions ().setTagHandling ("xml" ).setIgnoreTags (Arrays .asList ("xml" ));
9893 String arIgnorePart = "<ignore>يجب تجاهل هذا الجزء.</ignore>" ;
9994 String enSentenceWithArIgnorePart =
100- "<p>This is a <b>short</b> <i>sentence</i>. " + arIgnorePart + " This is another sentence." ;
95+ "<p>This is a <b>short</b> <i>sentence</i>.</p>"
96+ + arIgnorePart
97+ + " This is another sentence." ;
10198 String enIgnorePart = "<ignore>This part should be ignored.</ignore>" ;
10299 String arSentenceWithEnIgnorePart =
103100 "<p>هذه <i>جملة</i> <b>قصيرة</b>. " + enIgnorePart + "هذه جملة أخرى.</p>" ;
0 commit comments