Guy Carmeli hace 7 años
padre
commit
97ad59cb14

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ModalStackTest.java Ver fichero

12
 
12
 
13
 import javax.annotation.Nullable;
13
 import javax.annotation.Nullable;
14
 
14
 
15
-import static org.assertj.core.api.Assertions.assertThat;
15
+import static org.assertj.core.api.Java6Assertions.assertThat;
16
 import static org.mockito.ArgumentMatchers.any;
16
 import static org.mockito.ArgumentMatchers.any;
17
 import static org.mockito.Mockito.spy;
17
 import static org.mockito.Mockito.spy;
18
 import static org.mockito.Mockito.times;
18
 import static org.mockito.Mockito.times;

+ 36
- 35
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/StackControllerTest.java Ver fichero

22
 
22
 
23
 import org.assertj.core.api.iterable.Extractor;
23
 import org.assertj.core.api.iterable.Extractor;
24
 import org.json.JSONObject;
24
 import org.json.JSONObject;
25
+import org.junit.Ignore;
25
 import org.junit.Test;
26
 import org.junit.Test;
26
 import org.mockito.ArgumentCaptor;
27
 import org.mockito.ArgumentCaptor;
27
 import org.mockito.Mockito;
28
 import org.mockito.Mockito;
55
     }
56
     }
56
 
57
 
57
     @Test
58
     @Test
58
-    public void isAViewController() throws Exception {
59
+    public void isAViewController() {
59
         assertThat(uut).isInstanceOf(ViewController.class);
60
         assertThat(uut).isInstanceOf(ViewController.class);
60
     }
61
     }
61
 
62
 
62
     @Test
63
     @Test
63
-    public void holdsAStackOfViewControllers() throws Exception {
64
+    public void holdsAStackOfViewControllers() {
64
         assertThat(uut.isEmpty()).isTrue();
65
         assertThat(uut.isEmpty()).isTrue();
65
         uut.animatePush(child1, new MockPromise());
66
         uut.animatePush(child1, new MockPromise());
66
         uut.animatePush(child2, new MockPromise());
67
         uut.animatePush(child2, new MockPromise());
70
     }
71
     }
71
 
72
 
72
     @Test
73
     @Test
73
-    public void push() throws Exception {
74
+    public void push() {
74
         assertThat(uut.isEmpty()).isTrue();
75
         assertThat(uut.isEmpty()).isTrue();
75
         uut.animatePush(child1, new MockPromise());
76
         uut.animatePush(child1, new MockPromise());
76
         assertContainsOnlyId(child1.getId());
77
         assertContainsOnlyId(child1.getId());
77
     }
78
     }
78
 
79
 
79
     @Test
80
     @Test
80
-    public void pop() throws Exception {
81
+    public void pop() {
81
         uut.animatePush(child1, new MockPromise());
82
         uut.animatePush(child1, new MockPromise());
82
         uut.animatePush(child2, new MockPromise() {
83
         uut.animatePush(child2, new MockPromise() {
83
             @Override
84
             @Override
90
     }
91
     }
91
 
92
 
92
     @Test
93
     @Test
93
-    public void pop_appliesOptionsAfterPop() throws Exception {
94
+    public void pop_appliesOptionsAfterPop() {
94
         uut.animatePush(child1, new MockPromise());
95
         uut.animatePush(child1, new MockPromise());
95
         uut.animatePush(child2, new MockPromise() {
96
         uut.animatePush(child2, new MockPromise() {
96
             @Override
97
             @Override
102
     }
103
     }
103
 
104
 
104
     @Test
105
     @Test
105
-    public void pop_layoutHandlesChildWillDisappear() throws Exception {
106
+    public void pop_layoutHandlesChildWillDisappear() {
106
         final StackLayout[] stackLayout = new StackLayout[1];
107
         final StackLayout[] stackLayout = new StackLayout[1];
107
         uut = new StackController(activity, new TopBarButtonCreatorMock(), new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), "uut", new Options()) {
108
         uut = new StackController(activity, new TopBarButtonCreatorMock(), new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), "uut", new Options()) {
108
             @NonNull
109
             @NonNull
128
     }
129
     }
129
 
130
 
130
     @Test
131
     @Test
131
-    public void stackOperations() throws Exception {
132
+    public void stackOperations() {
132
         assertThat(uut.peek()).isNull();
133
         assertThat(uut.peek()).isNull();
133
         assertThat(uut.size()).isZero();
134
         assertThat(uut.size()).isZero();
134
         assertThat(uut.isEmpty()).isTrue();
135
         assertThat(uut.isEmpty()).isTrue();
139
     }
140
     }
140
 
141
 
141
     @Test
142
     @Test
142
-    public void pushAssignsRefToSelfOnPushedController() throws Exception {
143
+    public void pushAssignsRefToSelfOnPushedController() {
143
         assertThat(child1.getParentController()).isNull();
144
         assertThat(child1.getParentController()).isNull();
144
         uut.animatePush(child1, new MockPromise());
145
         uut.animatePush(child1, new MockPromise());
145
         assertThat(child1.getParentController()).isEqualTo(uut);
146
         assertThat(child1.getParentController()).isEqualTo(uut);
150
     }
151
     }
151
 
152
 
152
     @Test
153
     @Test
153
-    public void handleBack_PopsUnlessSingleChild() throws Exception {
154
+    public void handleBack_PopsUnlessSingleChild() {
154
         assertThat(uut.isEmpty()).isTrue();
155
         assertThat(uut.isEmpty()).isTrue();
155
         assertThat(uut.handleBack()).isFalse();
156
         assertThat(uut.handleBack()).isFalse();
156
 
157
 
171
     }
172
     }
172
 
173
 
173
     @Test
174
     @Test
174
-    public void popDoesNothingWhenZeroOrOneChild() throws Exception {
175
+    public void popDoesNothingWhenZeroOrOneChild() {
175
         assertThat(uut.isEmpty()).isTrue();
176
         assertThat(uut.isEmpty()).isTrue();
176
         uut.pop(new MockPromise());
177
         uut.pop(new MockPromise());
177
         assertThat(uut.isEmpty()).isTrue();
178
         assertThat(uut.isEmpty()).isTrue();
182
     }
183
     }
183
 
184
 
184
     @Test
185
     @Test
185
-    public void canPopWhenSizeIsMoreThanOne() throws Exception {
186
+    public void canPopWhenSizeIsMoreThanOne() {
186
         assertThat(uut.isEmpty()).isTrue();
187
         assertThat(uut.isEmpty()).isTrue();
187
         assertThat(uut.canPop()).isFalse();
188
         assertThat(uut.canPop()).isFalse();
188
         uut.animatePush(child1, new MockPromise());
189
         uut.animatePush(child1, new MockPromise());
194
     }
195
     }
195
 
196
 
196
     @Test
197
     @Test
197
-    public void pushAddsToViewTree() throws Exception {
198
+    public void pushAddsToViewTree() {
198
         assertThat(uut.getView().findViewById(child1.getView().getId())).isNull();
199
         assertThat(uut.getView().findViewById(child1.getView().getId())).isNull();
199
         uut.animatePush(child1, new MockPromise());
200
         uut.animatePush(child1, new MockPromise());
200
         assertThat(uut.getView().findViewById(child1.getView().getId())).isNotNull();
201
         assertThat(uut.getView().findViewById(child1.getView().getId())).isNotNull();
201
     }
202
     }
202
 
203
 
203
     @Test
204
     @Test
204
-    public void pushRemovesPreviousFromTree() throws Exception {
205
+    public void pushRemovesPreviousFromTree() {
205
         assertThat(uut.getView().findViewById(child1.getView().getId())).isNull();
206
         assertThat(uut.getView().findViewById(child1.getView().getId())).isNull();
206
         uut.animatePush(child1, new MockPromise());
207
         uut.animatePush(child1, new MockPromise());
207
         assertThat(uut.getView().findViewById(child1.getView().getId())).isNotNull();
208
         assertThat(uut.getView().findViewById(child1.getView().getId())).isNotNull();
215
     }
216
     }
216
 
217
 
217
     @Test
218
     @Test
218
-    public void popReplacesViewWithPrevious() throws Exception {
219
+    public void popReplacesViewWithPrevious() {
219
         final View child2View = child2.getView();
220
         final View child2View = child2.getView();
220
         final View child1View = child1.getView();
221
         final View child1View = child1.getView();
221
 
222
 
233
     }
234
     }
234
 
235
 
235
     @Test
236
     @Test
236
-    public void popSpecificWhenTopIsRegularPop() throws Exception {
237
+    public void popSpecificWhenTopIsRegularPop() {
237
         uut.animatePush(child1, new MockPromise());
238
         uut.animatePush(child1, new MockPromise());
238
         uut.animatePush(child2, new MockPromise() {
239
         uut.animatePush(child2, new MockPromise() {
239
             @Override
240
             @Override
250
     }
251
     }
251
 
252
 
252
     @Test
253
     @Test
253
-    public void popSpecificDeepInStack() throws Exception {
254
+    public void popSpecificDeepInStack() {
254
         uut.animatePush(child1, new MockPromise());
255
         uut.animatePush(child1, new MockPromise());
255
         uut.animatePush(child2, new MockPromise());
256
         uut.animatePush(child2, new MockPromise());
256
         assertIsChildById(uut.getView(), child2.getView());
257
         assertIsChildById(uut.getView(), child2.getView());
260
     }
261
     }
261
 
262
 
262
     @Test
263
     @Test
263
-    public void popTo_PopsTopUntilControllerIsNewTop() throws Exception {
264
+    public void popTo_PopsTopUntilControllerIsNewTop() {
264
         uut.animatePush(child1, new MockPromise());
265
         uut.animatePush(child1, new MockPromise());
265
         uut.animatePush(child2, new MockPromise());
266
         uut.animatePush(child2, new MockPromise());
266
         uut.animatePush(child3, new MockPromise() {
267
         uut.animatePush(child3, new MockPromise() {
278
     }
279
     }
279
 
280
 
280
     @Test
281
     @Test
281
-    public void popTo_NotAChildOfThisStack_DoesNothing() throws Exception {
282
+    public void popTo_NotAChildOfThisStack_DoesNothing() {
282
         uut.animatePush(child1, new MockPromise());
283
         uut.animatePush(child1, new MockPromise());
283
         uut.animatePush(child3, new MockPromise());
284
         uut.animatePush(child3, new MockPromise());
284
         assertThat(uut.size()).isEqualTo(2);
285
         assertThat(uut.size()).isEqualTo(2);
287
     }
288
     }
288
 
289
 
289
     @Test
290
     @Test
290
-    public void popToRoot_PopsEverythingAboveFirstController() throws Exception {
291
+    public void popToRoot_PopsEverythingAboveFirstController() {
291
         uut.animatePush(child1, new MockPromise());
292
         uut.animatePush(child1, new MockPromise());
292
         uut.animatePush(child2, new MockPromise());
293
         uut.animatePush(child2, new MockPromise());
293
         uut.animatePush(child3, new MockPromise() {
294
         uut.animatePush(child3, new MockPromise() {
308
     }
309
     }
309
 
310
 
310
     @Test
311
     @Test
311
-    public void popToRoot_EmptyStackDoesNothing() throws Exception {
312
+    public void popToRoot_EmptyStackDoesNothing() {
312
         assertThat(uut.isEmpty()).isTrue();
313
         assertThat(uut.isEmpty()).isTrue();
313
         uut.popToRoot(new MockPromise());
314
         uut.popToRoot(new MockPromise());
314
         assertThat(uut.isEmpty()).isTrue();
315
         assertThat(uut.isEmpty()).isTrue();
315
     }
316
     }
316
 
317
 
317
     @Test
318
     @Test
318
-    public void findControllerById_ReturnsSelfOrChildrenById() throws Exception {
319
+    public void findControllerById_ReturnsSelfOrChildrenById() {
319
         assertThat(uut.findControllerById("123")).isNull();
320
         assertThat(uut.findControllerById("123")).isNull();
320
         assertThat(uut.findControllerById(uut.getId())).isEqualTo(uut);
321
         assertThat(uut.findControllerById(uut.getId())).isEqualTo(uut);
321
         uut.animatePush(child1, new MockPromise());
322
         uut.animatePush(child1, new MockPromise());
323
     }
324
     }
324
 
325
 
325
     @Test
326
     @Test
326
-    public void findControllerById_Deeply() throws Exception {
327
+    public void findControllerById_Deeply() {
327
         StackController stack = createStackController("another");
328
         StackController stack = createStackController("another");
328
         stack.animatePush(child2, new MockPromise());
329
         stack.animatePush(child2, new MockPromise());
329
         uut.animatePush(stack, new MockPromise());
330
         uut.animatePush(stack, new MockPromise());
331
     }
332
     }
332
 
333
 
333
     @Test
334
     @Test
334
-    public void pop_CallsDestroyOnPoppedChild() throws Exception {
335
+    public void pop_CallsDestroyOnPoppedChild() {
335
         child1 = spy(child1);
336
         child1 = spy(child1);
336
         child2 = spy(child2);
337
         child2 = spy(child2);
337
         child3 = spy(child3);
338
         child3 = spy(child3);
348
     }
349
     }
349
 
350
 
350
     @Test
351
     @Test
351
-    public void pop_callWillAppearWillDisappear() throws Exception {
352
+    public void pop_callWillAppearWillDisappear() {
352
         child1 = spy(child1);
353
         child1 = spy(child1);
353
         child2 = spy(child2);
354
         child2 = spy(child2);
354
         uut.push(child1, new MockPromise());
355
         uut.push(child1, new MockPromise());
359
     }
360
     }
360
 
361
 
361
     @Test
362
     @Test
362
-    public void pop_animatesTopBarIfNeeded() throws Exception {
363
+    public void pop_animatesTopBarIfNeeded() {
363
         uut.ensureViewIsCreated();
364
         uut.ensureViewIsCreated();
364
 
365
 
365
         child1.options.topBarOptions.visible = new Bool(false);
366
         child1.options.topBarOptions.visible = new Bool(false);
379
     }
380
     }
380
 
381
 
381
     @Test
382
     @Test
382
-    public void popSpecific_CallsDestroyOnPoppedChild() throws Exception {
383
+    public void popSpecific_CallsDestroyOnPoppedChild() {
383
         child1 = spy(child1);
384
         child1 = spy(child1);
384
         child2 = spy(child2);
385
         child2 = spy(child2);
385
         child3 = spy(child3);
386
         child3 = spy(child3);
393
     }
394
     }
394
 
395
 
395
     @Test
396
     @Test
396
-    public void popTo_CallsDestroyOnPoppedChild() throws Exception {
397
+    public void popTo_CallsDestroyOnPoppedChild() {
397
         child1 = spy(child1);
398
         child1 = spy(child1);
398
         child2 = spy(child2);
399
         child2 = spy(child2);
399
         child3 = spy(child3);
400
         child3 = spy(child3);
417
     }
418
     }
418
 
419
 
419
     @Test
420
     @Test
420
-    public void stackCanBePushed() throws Exception {
421
+    public void stackCanBePushed() {
421
         StackController parent = createStackController("someStack");
422
         StackController parent = createStackController("someStack");
422
         parent.ensureViewIsCreated();
423
         parent.ensureViewIsCreated();
423
         parent.push(uut, new MockPromise());
424
         parent.push(uut, new MockPromise());
426
     }
427
     }
427
 
428
 
428
     @Test
429
     @Test
429
-    public void applyOptions_applyOnlyOnFirstStack() throws Exception {
430
+    public void applyOptions_applyOnlyOnFirstStack() {
430
         StackController parent = spy(createStackController("someStack"));
431
         StackController parent = spy(createStackController("someStack"));
431
         parent.ensureViewIsCreated();
432
         parent.ensureViewIsCreated();
432
         parent.push(uut, new MockPromise());
433
         parent.push(uut, new MockPromise());
445
     }
446
     }
446
 
447
 
447
     @Test
448
     @Test
448
-    public void applyOptions_topTabsAreNotVisibleIfNoTabsAreDefined() throws Exception {
449
+    public void applyOptions_topTabsAreNotVisibleIfNoTabsAreDefined() {
449
         uut.ensureViewIsCreated();
450
         uut.ensureViewIsCreated();
450
         uut.push(child1, new MockPromise());
451
         uut.push(child1, new MockPromise());
451
         child1.ensureViewIsCreated();
452
         child1.ensureViewIsCreated();
454
     }
455
     }
455
 
456
 
456
     @Test
457
     @Test
457
-    public void buttonPressInvokedOnCurrentStack() throws Exception {
458
+    public void buttonPressInvokedOnCurrentStack() {
458
         uut.ensureViewIsCreated();
459
         uut.ensureViewIsCreated();
459
         uut.push(child1, new MockPromise());
460
         uut.push(child1, new MockPromise());
460
         uut.sendOnNavigationButtonPressed("btn1");
461
         uut.sendOnNavigationButtonPressed("btn1");
462
     }
463
     }
463
 
464
 
464
     @Test
465
     @Test
465
-    public void mergeChildOptions_updatesViewWithNewOptions() throws Exception {
466
+    public void mergeChildOptions_updatesViewWithNewOptions() {
466
         final StackLayout[] stackLayout = new StackLayout[1];
467
         final StackLayout[] stackLayout = new StackLayout[1];
467
         StackController uut = new StackController(activity, new TopBarButtonCreatorMock(), new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), "stack", new Options()) {
468
         StackController uut = new StackController(activity, new TopBarButtonCreatorMock(), new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), "stack", new Options()) {
468
             @NonNull
469
             @NonNull
479
     }
480
     }
480
 
481
 
481
     @Test
482
     @Test
482
-    public void mergeChildOptions_updatesParentControllerWithNewOptions() throws Exception {
483
+    public void mergeChildOptions_updatesParentControllerWithNewOptions() {
483
         final StackLayout[] stackLayout = new StackLayout[1];
484
         final StackLayout[] stackLayout = new StackLayout[1];
484
         StackController uut = new StackController(activity, new TopBarButtonCreatorMock(), new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), "stack", new Options()) {
485
         StackController uut = new StackController(activity, new TopBarButtonCreatorMock(), new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), "stack", new Options()) {
485
             @NonNull
486
             @NonNull
504
     }
505
     }
505
 
506
 
506
     @Test
507
     @Test
507
-    public void mergeChildOptions_mergeAnimationOptions() throws Exception {
508
+    public void mergeChildOptions_mergeAnimationOptions() {
508
         Options options = new Options();
509
         Options options = new Options();
509
         Component component = mock(Component.class);
510
         Component component = mock(Component.class);
510
 
511
 
514
     }
515
     }
515
 
516
 
516
     @Test
517
     @Test
517
-    public void mergeChildOptions_StackRelatedOptionsAreCleared() throws Exception {
518
+    public void mergeChildOptions_StackRelatedOptionsAreCleared() {
518
         ParentController parentController = Mockito.mock(ParentController.class);
519
         ParentController parentController = Mockito.mock(ParentController.class);
519
         uut.setParentController(parentController);
520
         uut.setParentController(parentController);
520
         Options options = new Options();
521
         Options options = new Options();

+ 10
- 10
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TitleBarTest.java Ver fichero

87
     }
87
     }
88
 
88
 
89
     @Test
89
     @Test
90
-    public void destroy_destroysButtonControllers() throws Exception {
90
+    public void destroy_destroysButtonControllers() {
91
         uut.setLeftButtons(leftButton(leftButton));
91
         uut.setLeftButtons(leftButton(leftButton));
92
         uut.setRightButtons(rightButtons(customButton, textButton));
92
         uut.setRightButtons(rightButtons(customButton, textButton));
93
         uut.clear();
93
         uut.clear();
97
     }
97
     }
98
 
98
 
99
     @Test
99
     @Test
100
-    public void setRightButtons_destroysRightButtons() throws Exception {
100
+    public void setRightButtons_destroysRightButtons() {
101
         uut.setLeftButtons(leftButton(leftButton));
101
         uut.setLeftButtons(leftButton(leftButton));
102
         uut.setRightButtons(rightButtons(customButton));
102
         uut.setRightButtons(rightButtons(customButton));
103
         uut.setLeftButtons(leftButton(leftButton));
103
         uut.setLeftButtons(leftButton(leftButton));
106
     }
106
     }
107
 
107
 
108
     @Test
108
     @Test
109
-    public void setRightButtons_onlyDestroysRightButtons() throws Exception {
109
+    public void setRightButtons_onlyDestroysRightButtons() {
110
         uut.setLeftButtons(leftButton(leftButton));
110
         uut.setLeftButtons(leftButton(leftButton));
111
         uut.setRightButtons(rightButtons(customButton));
111
         uut.setRightButtons(rightButtons(customButton));
112
         uut.setLeftButtons(null);
112
         uut.setLeftButtons(null);
115
     }
115
     }
116
 
116
 
117
     @Test
117
     @Test
118
-    public void setRightButtons_emptyButtonsListClearsRightButtons() throws Exception {
118
+    public void setRightButtons_emptyButtonsListClearsRightButtons() {
119
         uut.setLeftButtons(new ArrayList<>());
119
         uut.setLeftButtons(new ArrayList<>());
120
         uut.setRightButtons(rightButtons(customButton, textButton));
120
         uut.setRightButtons(rightButtons(customButton, textButton));
121
         uut.setLeftButtons(new ArrayList<>());
121
         uut.setLeftButtons(new ArrayList<>());
127
     }
127
     }
128
 
128
 
129
     @Test
129
     @Test
130
-    public void setLeftButtons_emptyButtonsListClearsLeftButton() throws Exception {
130
+    public void setLeftButtons_emptyButtonsListClearsLeftButton() {
131
         uut.setLeftButtons(leftButton(leftButton));
131
         uut.setLeftButtons(leftButton(leftButton));
132
         uut.setRightButtons(rightButtons(customButton));
132
         uut.setRightButtons(rightButtons(customButton));
133
         uut.setLeftButtons(new ArrayList<>());
133
         uut.setLeftButtons(new ArrayList<>());
136
     }
136
     }
137
 
137
 
138
     @Test
138
     @Test
139
-    public void setRightButtons_buttonsAreAddedInReverseOrderToMatchOrderOnIOs() throws Exception {
139
+    public void setRightButtons_buttonsAreAddedInReverseOrderToMatchOrderOnIOs() {
140
         uut.setLeftButtons(new ArrayList<>());
140
         uut.setLeftButtons(new ArrayList<>());
141
         uut.setRightButtons(rightButtons(textButton, customButton));
141
         uut.setRightButtons(rightButtons(textButton, customButton));
142
         assertThat(uut.getMenu().getItem(1).getTitle()).isEqualTo(textButton.title.get());
142
         assertThat(uut.getMenu().getItem(1).getTitle()).isEqualTo(textButton.title.get());
143
     }
143
     }
144
 
144
 
145
     @Test
145
     @Test
146
-    public void setComponent_addsComponentToTitleBar() throws Exception {
146
+    public void setComponent_addsComponentToTitleBar() {
147
         uut.setComponent("com.rnn.CustomView", TitleOptions.Alignment.Center);
147
         uut.setComponent("com.rnn.CustomView", TitleOptions.Alignment.Center);
148
         verify(uut, times(1)).addView(any(TitleBarReactView.class), any(Toolbar.LayoutParams.class));
148
         verify(uut, times(1)).addView(any(TitleBarReactView.class), any(Toolbar.LayoutParams.class));
149
     }
149
     }
150
 
150
 
151
     @Test
151
     @Test
152
-    public void setComponent_alignFill() throws Exception {
152
+    public void setComponent_alignFill() {
153
         uut.setComponent("com.rnn.CustomView", TitleOptions.Alignment.Fill);
153
         uut.setComponent("com.rnn.CustomView", TitleOptions.Alignment.Fill);
154
         verify(uut, times(1)).getComponentLayoutParams(TitleOptions.Alignment.Fill);
154
         verify(uut, times(1)).getComponentLayoutParams(TitleOptions.Alignment.Fill);
155
         ArgumentCaptor<Toolbar.LayoutParams> lpCaptor = ArgumentCaptor.forClass(Toolbar.LayoutParams.class);
155
         ArgumentCaptor<Toolbar.LayoutParams> lpCaptor = ArgumentCaptor.forClass(Toolbar.LayoutParams.class);
158
     }
158
     }
159
 
159
 
160
     @Test
160
     @Test
161
-    public void setComponent_alignCenter() throws Exception {
161
+    public void setComponent_alignCenter() {
162
         uut.setComponent("com.rnn.CustomView", TitleOptions.Alignment.Center);
162
         uut.setComponent("com.rnn.CustomView", TitleOptions.Alignment.Center);
163
         verify(uut, times(1)).getComponentLayoutParams(TitleOptions.Alignment.Center);
163
         verify(uut, times(1)).getComponentLayoutParams(TitleOptions.Alignment.Center);
164
         ArgumentCaptor<Toolbar.LayoutParams> lpCaptor = ArgumentCaptor.forClass(Toolbar.LayoutParams.class);
164
         ArgumentCaptor<Toolbar.LayoutParams> lpCaptor = ArgumentCaptor.forClass(Toolbar.LayoutParams.class);
168
     }
168
     }
169
 
169
 
170
     @Test
170
     @Test
171
-    public void clear() throws Exception {
171
+    public void clear() {
172
         uut.setComponent("someComponent", TitleOptions.Alignment.Center);
172
         uut.setComponent("someComponent", TitleOptions.Alignment.Center);
173
         uut.clear();
173
         uut.clear();
174
         assertThat(uut.getTitle()).isNullOrEmpty();
174
         assertThat(uut.getTitle()).isNullOrEmpty();

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabsViewControllerTest.java Ver fichero

29
 
29
 
30
 import javax.annotation.Nullable;
30
 import javax.annotation.Nullable;
31
 
31
 
32
-import static org.assertj.core.api.Assertions.assertThat;
32
+import static org.assertj.core.api.Java6Assertions.assertThat;
33
 import static org.mockito.ArgumentMatchers.any;
33
 import static org.mockito.ArgumentMatchers.any;
34
 import static org.mockito.ArgumentMatchers.eq;
34
 import static org.mockito.ArgumentMatchers.eq;
35
 import static org.mockito.Mockito.spy;
35
 import static org.mockito.Mockito.spy;

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/views/TouchDelegateTest.java Ver fichero

8
 
8
 
9
 import org.junit.Test;
9
 import org.junit.Test;
10
 
10
 
11
-import static org.assertj.core.api.Assertions.assertThat;
11
+import static org.assertj.core.api.Java6Assertions.assertThat;
12
 import static org.mockito.Mockito.spy;
12
 import static org.mockito.Mockito.spy;
13
 import static org.mockito.Mockito.times;
13
 import static org.mockito.Mockito.times;
14
 import static org.mockito.Mockito.verify;
14
 import static org.mockito.Mockito.verify;