File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
src/test/java/io/simplelocalize/cli/command Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,48 @@ public void shouldUploadOneFileWithLangTemplate() throws Exception
7272 );
7373 }
7474
75+ @ Test
76+ public void shouldUploadOneFileWithOnlyTranslationKeys () throws Exception
77+ {
78+ //given
79+ Configuration configuration = new Configuration ();
80+ configuration .setApiKey ("my-api-key" );
81+ configuration .setUploadPath ("./junit/download-test/values-en/strings.xml" );
82+ configuration .setUploadFormat ("android" );
83+
84+ //when
85+ UploadCommand uploadCommand = new UploadCommand (client , configuration );
86+ uploadCommand .invoke ();
87+
88+ //then
89+ Mockito .verify (client , Mockito .times (1 )).uploadFile (
90+ Mockito .refEq (UploadRequest .UploadFileRequestBuilder .anUploadFileRequest ()
91+ .withPath (Path .of ("./junit/download-test/values-en/strings.xml" ))
92+ .withFormat ("android" )
93+ .withLanguageKey ("" )
94+ .withOptions (Collections .emptyList ())
95+ .build ()
96+ )
97+ );
98+ }
99+
100+ @ Test
101+ public void shouldSkipEmptyFile () throws Exception
102+ {
103+ //given
104+ Configuration configuration = new Configuration ();
105+ configuration .setApiKey ("my-api-key" );
106+ configuration .setUploadPath ("./junit/empty-test/strings.xml" );
107+ configuration .setUploadFormat ("android" );
108+
109+ //when
110+ UploadCommand uploadCommand = new UploadCommand (client , configuration );
111+ uploadCommand .invoke ();
112+
113+ //then
114+ Mockito .verifyNoInteractions (client );
115+ }
116+
75117 @ Test
76118 public void shouldUploadOneFile () throws Exception
77119 {
You can’t perform that action at this time.
0 commit comments