@@ -212,6 +212,70 @@ void testConstructorWithAllFields() {
212212 assertEquals (2 , model .tags .length );
213213 }
214214
215+ // ========== LOCALE / LANGUAGE TESTS (asset localisation) ==========
216+
217+ @ Test
218+ void testConstructorWithLocaleIsArrayTrue () {
219+ JSONObject response = new JSONObject ();
220+ response .put ("uid" , "localized_asset" );
221+ response .put ("filename" , "localized.jpg" );
222+ response .put ("locale" , "en-us" );
223+
224+ AssetModel model = new AssetModel (response , true );
225+
226+ assertNotNull (model );
227+ assertEquals ("localized_asset" , model .uploadedUid );
228+ assertEquals ("en-us" , model .language );
229+ }
230+
231+ @ Test
232+ void testConstructorWithoutLocaleLeavesLanguageNull () {
233+ JSONObject response = new JSONObject ();
234+ response .put ("uid" , "no_locale_asset" );
235+ response .put ("filename" , "test.jpg" );
236+
237+ AssetModel model = new AssetModel (response , true );
238+
239+ assertNotNull (model );
240+ assertNull (model .language );
241+ }
242+
243+ @ Test
244+ void testConstructorWithVariousLocaleCodes () {
245+ JSONObject response = new JSONObject ();
246+ response .put ("uid" , "uid" );
247+ response .put ("locale" , "fr-fr" );
248+
249+ AssetModel model = new AssetModel (response , true );
250+ assertEquals ("fr-fr" , model .language );
251+
252+ JSONObject response2 = new JSONObject ();
253+ response2 .put ("uid" , "uid2" );
254+ response2 .put ("locale" , "ja-jp" );
255+ AssetModel model2 = new AssetModel (response2 , true );
256+ assertEquals ("ja-jp" , model2 .language );
257+ }
258+
259+ @ Test
260+ void testConstructorWithLocaleAndOtherFields () {
261+ JSONObject response = new JSONObject ();
262+ response .put ("uid" , "full_localized" );
263+ response .put ("content_type" , "image/png" );
264+ response .put ("file_size" , "1024" );
265+ response .put ("filename" , "image.png" );
266+ response .put ("url" , "https://cdn.example.com/image.png" );
267+ response .put ("locale" , "de-de" );
268+
269+ AssetModel model = new AssetModel (response , true );
270+
271+ assertEquals ("full_localized" , model .uploadedUid );
272+ assertEquals ("image/png" , model .contentType );
273+ assertEquals ("1024" , model .fileSize );
274+ assertEquals ("image.png" , model .fileName );
275+ assertEquals ("https://cdn.example.com/image.png" , model .uploadUrl );
276+ assertEquals ("de-de" , model .language );
277+ }
278+
215279 @ Test
216280 void testConstructorWithMinimalData () {
217281 JSONObject response = new JSONObject ();
0 commit comments