2020import static junit .framework .Assert .assertEquals ;
2121import static junit .framework .Assert .assertNotNull ;
2222import static junit .framework .Assert .assertTrue ;
23- import static org .mockito .ArgumentMatchers .any ;
24- import static org .mockito .Mockito .doCallRealMethod ;
25- import static org .mockito .Mockito .never ;
26- import static org .mockito .Mockito .spy ;
27- import static org .mockito .Mockito .times ;
28- import static org .mockito .Mockito .verify ;
2923import static org .robolectric .Shadows .shadowOf ;
3024
3125public class IterableInAppHTMLNotificationTest extends BaseTest {
@@ -146,7 +140,7 @@ public void testResizeValidation_HandlesGracefully() {
146140 public void testApplyWindowGravity_Center () {
147141 Rect padding = new Rect (0 , -1 , 0 , -1 ); // Center padding
148142 IterableInAppFragmentHTMLNotification notification = IterableInAppFragmentHTMLNotification .createInstance (
149- "<html><body>Test</body></html>" , false , uri -> {}, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
143+ "<html><body>Test</body></html>" , false , uri -> { }, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
150144
151145 // Verify gravity calculation for center padding
152146 assertEquals (Gravity .CENTER_VERTICAL , notification .getVerticalLocation (padding ));
@@ -156,7 +150,7 @@ public void testApplyWindowGravity_Center() {
156150 public void testApplyWindowGravity_Top () {
157151 Rect padding = new Rect (0 , 0 , 0 , -1 ); // Top padding
158152 IterableInAppFragmentHTMLNotification notification = IterableInAppFragmentHTMLNotification .createInstance (
159- "<html><body>Test</body></html>" , false , uri -> {}, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
153+ "<html><body>Test</body></html>" , false , uri -> { }, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
160154
161155 assertEquals (Gravity .TOP , notification .getVerticalLocation (padding ));
162156 }
@@ -165,7 +159,7 @@ public void testApplyWindowGravity_Top() {
165159 public void testApplyWindowGravity_Bottom () {
166160 Rect padding = new Rect (0 , -1 , 0 , 0 ); // Bottom padding
167161 IterableInAppFragmentHTMLNotification notification = IterableInAppFragmentHTMLNotification .createInstance (
168- "<html><body>Test</body></html>" , false , uri -> {}, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
162+ "<html><body>Test</body></html>" , false , uri -> { }, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
169163
170164 assertEquals (Gravity .BOTTOM , notification .getVerticalLocation (padding ));
171165 }
@@ -174,8 +168,8 @@ public void testApplyWindowGravity_Bottom() {
174168 public void testApplyWindowGravity_HandlesNullWindow () {
175169 Rect padding = new Rect (0 , 0 , 0 , -1 );
176170 IterableInAppFragmentHTMLNotification notification = IterableInAppFragmentHTMLNotification .createInstance (
177- "<html><body>Test</body></html>" , false , uri -> {}, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
178-
171+ "<html><body>Test</body></html>" , false , uri -> { }, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
172+
179173 // Test that getVerticalLocation works correctly
180174 assertEquals (Gravity .TOP , notification .getVerticalLocation (padding ));
181175 // applyWindowGravity is private but is called in onStart/onCreateDialog/onCreateView
@@ -300,7 +294,7 @@ public void testOrientationChange_PortraitToLandscape() throws Exception {
300294 // The test passes if no exceptions are thrown and the resize was triggered
301295 // We verify indirectly by ensuring the notification still exists and is in a valid state
302296 assertNotNull ("Notification should still exist after orientation change" , notification );
303-
297+
304298 // The resize should have been triggered (1500ms delay + 200ms debounce)
305299 // If runResizeScript wasn't called, we would have seen validation errors or exceptions
306300 // The fact that we get here without exceptions means the orientation change handling worked
@@ -326,18 +320,18 @@ public void testRoundToNearest90Degrees_StandardOrientations() {
326320 public void testRoundToNearest90Degrees_BoundaryValues () {
327321 // Values that round down to 0 (0-44)
328322 assertEquals (0 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (44 ));
329-
323+
330324 // Values that round up to 90 (45-134)
331325 assertEquals (90 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (45 ));
332326 assertEquals (90 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (89 ));
333327 assertEquals (90 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (90 ));
334328 assertEquals (90 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (134 ));
335-
329+
336330 // Values that round up to 180 (135-224)
337331 assertEquals (180 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (135 ));
338332 assertEquals (180 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (180 ));
339333 assertEquals (180 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (224 ));
340-
334+
341335 // Values that round up to 270 (225-314)
342336 assertEquals (270 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (225 ));
343337 assertEquals (270 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (270 ));
0 commit comments