|
@@ -70,8 +70,7 @@ public class ProfileManagerModelTest {
|
70
|
70
|
when(configProvider.getOption("profile", "realname")).thenReturn(prefix + "realname");
|
71
|
71
|
when(configProvider.getOption("profile", "ident")).thenReturn(prefix + "ident");
|
72
|
72
|
|
73
|
|
- final Profile profile = new Profile(identityFactory, configProvider);
|
74
|
|
- return profile;
|
|
73
|
+ return new Profile(identityFactory, configProvider);
|
75
|
74
|
}
|
76
|
75
|
|
77
|
76
|
private ProfileManagerModel createModel() {
|
|
@@ -82,7 +81,7 @@ public class ProfileManagerModelTest {
|
82
|
81
|
}
|
83
|
82
|
|
84
|
83
|
@Before
|
85
|
|
- public void setup() throws Exception {
|
|
84
|
+ public void setup() {
|
86
|
85
|
final List<ConfigProvider> identities = Collections.emptyList();
|
87
|
86
|
manager = mock(IdentityController.class);
|
88
|
87
|
when(manager.getProvidersByType("profile")).thenReturn(identities);
|
|
@@ -106,7 +105,7 @@ public class ProfileManagerModelTest {
|
106
|
105
|
final IdentityController im = mock(IdentityController.class);
|
107
|
106
|
when(im.getProvidersByType("profile")).thenReturn(identities);
|
108
|
107
|
|
109
|
|
- ProfileManagerModel instance = new ProfileManagerModel(im, identityFactory);
|
|
108
|
+ final ProfileManagerModel instance = new ProfileManagerModel(im, identityFactory);
|
110
|
109
|
instance.load();
|
111
|
110
|
|
112
|
111
|
assertEquals(Arrays.asList(new Profile[]{new Profile(identityFactory, configProvider), }), instance.getProfiles());
|
|
@@ -119,7 +118,7 @@ public class ProfileManagerModelTest {
|
119
|
118
|
public void testGetAndSetProfiles() {
|
120
|
119
|
final List<Profile> newProfiles = Arrays.asList(
|
121
|
120
|
new Profile[]{createProfile("2"),});
|
122
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
121
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
123
|
122
|
assertEquals(Collections.emptyList(), instance.getProfiles());
|
124
|
123
|
instance.setProfiles(newProfiles);
|
125
|
124
|
assertEquals(newProfiles, instance.getProfiles());
|
|
@@ -131,7 +130,7 @@ public class ProfileManagerModelTest {
|
131
|
130
|
@Test
|
132
|
131
|
public void testAddProfiles() {
|
133
|
132
|
final Profile newProfile = createProfile("2");
|
134
|
|
- ProfileManagerModel instance = createModel();
|
|
133
|
+ final ProfileManagerModel instance = createModel();
|
135
|
134
|
assertEquals(Arrays.asList(new Profile[]{defaultProfile,}), instance.getProfiles());
|
136
|
135
|
final List<Profile> newProfiles = new ArrayList<>();
|
137
|
136
|
newProfiles.add(defaultProfile);
|
|
@@ -146,7 +145,7 @@ public class ProfileManagerModelTest {
|
146
|
145
|
@Test
|
147
|
146
|
public void testDeleteProfileNullProfile() {
|
148
|
147
|
final Profile first = createProfile("1");
|
149
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
148
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
150
|
149
|
instance.addProfile(first);
|
151
|
150
|
instance.setSelectedProfile(first);
|
152
|
151
|
assertEquals(first, instance.getSelectedProfile());
|
|
@@ -161,7 +160,7 @@ public class ProfileManagerModelTest {
|
161
|
160
|
public void testDeleteProfileNotSelected() {
|
162
|
161
|
final Profile first = createProfile("1");
|
163
|
162
|
final Profile second = createProfile("2");
|
164
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
163
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
165
|
164
|
instance.addProfile(first);
|
166
|
165
|
instance.addProfile(second);
|
167
|
166
|
instance.setSelectedProfile(second);
|
|
@@ -177,7 +176,7 @@ public class ProfileManagerModelTest {
|
177
|
176
|
public void testDeleteProfileLastProfile() {
|
178
|
177
|
final Profile first = createProfile("1");
|
179
|
178
|
final Profile second = createProfile("2");
|
180
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
179
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
181
|
180
|
instance.addProfile(first);
|
182
|
181
|
instance.addProfile(second);
|
183
|
182
|
instance.setSelectedProfile(second);
|
|
@@ -193,7 +192,7 @@ public class ProfileManagerModelTest {
|
193
|
192
|
public void testDeleteProfileFirstProfile() {
|
194
|
193
|
final Profile first = createProfile("1");
|
195
|
194
|
final Profile second = createProfile("2");
|
196
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
195
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
197
|
196
|
instance.addProfile(first);
|
198
|
197
|
instance.addProfile(second);
|
199
|
198
|
instance.setSelectedProfile(first);
|
|
@@ -210,7 +209,7 @@ public class ProfileManagerModelTest {
|
210
|
209
|
final Profile first = createProfile("1");
|
211
|
210
|
final Profile second = createProfile("2");
|
212
|
211
|
final Profile third = createProfile("3");
|
213
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
212
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
214
|
213
|
instance.addProfile(first);
|
215
|
214
|
instance.addProfile(second);
|
216
|
215
|
instance.addProfile(third);
|
|
@@ -226,7 +225,7 @@ public class ProfileManagerModelTest {
|
226
|
225
|
@Test
|
227
|
226
|
public void testDeleteProfileOnlyProfile() {
|
228
|
227
|
final Profile first = createProfile("1");
|
229
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
228
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
230
|
229
|
instance.addProfile(first);
|
231
|
230
|
instance.setSelectedProfile(first);
|
232
|
231
|
assertEquals(first, instance.getSelectedProfile());
|
|
@@ -239,10 +238,10 @@ public class ProfileManagerModelTest {
|
239
|
238
|
*/
|
240
|
239
|
@Test
|
241
|
240
|
public void testGetAndSetSelectedProfile() {
|
242
|
|
- Profile profile2 = createProfile("2");
|
243
|
|
- Profile profile3 = createProfile("3");
|
244
|
|
- Profile profile4 = createProfile("4");
|
245
|
|
- ProfileManagerModel instance = createModel();
|
|
241
|
+ final Profile profile2 = createProfile("2");
|
|
242
|
+ final Profile profile3 = createProfile("3");
|
|
243
|
+ final Profile profile4 = createProfile("4");
|
|
244
|
+ final ProfileManagerModel instance = createModel();
|
246
|
245
|
assertEquals(defaultProfile, instance.getSelectedProfile());
|
247
|
246
|
instance.addProfile(profile2);
|
248
|
247
|
assertEquals(profile2, instance.getSelectedProfile());
|
|
@@ -258,7 +257,7 @@ public class ProfileManagerModelTest {
|
258
|
257
|
*/
|
259
|
258
|
@Test
|
260
|
259
|
public void testGetAndSetNicknames() {
|
261
|
|
- ProfileManagerModel instance = createModel();
|
|
260
|
+ final ProfileManagerModel instance = createModel();
|
262
|
261
|
final List<String> expResult = defaultProfile.getNicknames();
|
263
|
262
|
List<String> result = instance.getNicknames();
|
264
|
263
|
assertEquals(expResult, result);
|
|
@@ -272,8 +271,8 @@ public class ProfileManagerModelTest {
|
272
|
271
|
*/
|
273
|
272
|
@Test
|
274
|
273
|
public void testAddNickname() {
|
275
|
|
- String nickname = "foo";
|
276
|
|
- ProfileManagerModel instance = createModel();
|
|
274
|
+ final String nickname = "foo";
|
|
275
|
+ final ProfileManagerModel instance = createModel();
|
277
|
276
|
assertEquals(defaultProfile.getNicknames(), instance.getNicknames());
|
278
|
277
|
final List<String> nicknames = new ArrayList<>(defaultProfile.getNicknames());
|
279
|
278
|
instance.addNickname(nickname);
|
|
@@ -286,7 +285,7 @@ public class ProfileManagerModelTest {
|
286
|
285
|
*/
|
287
|
286
|
@Test
|
288
|
287
|
public void testDeleteNicknameObject() {
|
289
|
|
- ProfileManagerModel instance = createModel();
|
|
288
|
+ final ProfileManagerModel instance = createModel();
|
290
|
289
|
final List<String> nicknames = new ArrayList<>(instance.getNicknames());
|
291
|
290
|
Object nickname = (Object) "";
|
292
|
291
|
assertEquals(nicknames, instance.getNicknames());
|
|
@@ -303,7 +302,7 @@ public class ProfileManagerModelTest {
|
303
|
302
|
*/
|
304
|
303
|
@Test
|
305
|
304
|
public void testDeleteNicknameNullSelectedProfile() {
|
306
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
305
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
307
|
306
|
assertNull(instance.getSelectedProfile());
|
308
|
307
|
assertTrue(instance.getNicknames().isEmpty());
|
309
|
308
|
instance.deleteNickname("1nickname");
|
|
@@ -316,7 +315,7 @@ public class ProfileManagerModelTest {
|
316
|
315
|
public void testDeleteNicknameNullNickname() {
|
317
|
316
|
final Profile profile = createProfile("1");
|
318
|
317
|
final String first = "1nickname";
|
319
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
318
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
320
|
319
|
instance.addProfile(profile);
|
321
|
320
|
instance.setSelectedProfile(profile);
|
322
|
321
|
instance.setSelectedNickname(first);
|
|
@@ -333,7 +332,7 @@ public class ProfileManagerModelTest {
|
333
|
332
|
final Profile profile = createProfile("1");
|
334
|
333
|
final String first = "1nickname";
|
335
|
334
|
final String second = "1nickname2";
|
336
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
335
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
337
|
336
|
instance.addProfile(profile);
|
338
|
337
|
instance.setSelectedProfile(profile);
|
339
|
338
|
instance.addNickname(second);
|
|
@@ -351,7 +350,7 @@ public class ProfileManagerModelTest {
|
351
|
350
|
final Profile profile = createProfile("1");
|
352
|
351
|
final String first = "1nickname";
|
353
|
352
|
final String second = "1nickname2";
|
354
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
353
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
355
|
354
|
instance.addProfile(profile);
|
356
|
355
|
instance.setSelectedProfile(profile);
|
357
|
356
|
instance.addNickname(second);
|
|
@@ -369,7 +368,7 @@ public class ProfileManagerModelTest {
|
369
|
368
|
final Profile profile = createProfile("1");
|
370
|
369
|
final String first = "1nickname";
|
371
|
370
|
final String second = "1nickname2";
|
372
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
371
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
373
|
372
|
instance.addProfile(profile);
|
374
|
373
|
instance.setSelectedProfile(profile);
|
375
|
374
|
instance.addNickname(second);
|
|
@@ -388,7 +387,7 @@ public class ProfileManagerModelTest {
|
388
|
387
|
final String first = "1nickname";
|
389
|
388
|
final String second = "1nickname2";
|
390
|
389
|
final String third = "1nickname3";
|
391
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
390
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
392
|
391
|
instance.addProfile(profile);
|
393
|
392
|
instance.setSelectedProfile(profile);
|
394
|
393
|
instance.addNickname(second);
|
|
@@ -406,7 +405,7 @@ public class ProfileManagerModelTest {
|
406
|
405
|
public void testDeleteNicknameOnlyNickname() {
|
407
|
406
|
final Profile profile = createProfile("1");
|
408
|
407
|
final String first = "1nickname";
|
409
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
408
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
410
|
409
|
instance.addProfile(profile);
|
411
|
410
|
instance.setSelectedProfile(profile);
|
412
|
411
|
instance.setSelectedNickname(first);
|
|
@@ -421,7 +420,7 @@ public class ProfileManagerModelTest {
|
421
|
420
|
@Test
|
422
|
421
|
public void testGetAndSetSelectedNickname() {
|
423
|
422
|
final String selectedNickname = "1nickname";
|
424
|
|
- ProfileManagerModel instance = createModel();
|
|
423
|
+ final ProfileManagerModel instance = createModel();
|
425
|
424
|
assertNull(instance.getSelectedNickname());
|
426
|
425
|
instance.setSelectedNickname(selectedNickname);
|
427
|
426
|
assertEquals(selectedNickname, instance.getSelectedNickname());
|
|
@@ -434,7 +433,7 @@ public class ProfileManagerModelTest {
|
434
|
433
|
*/
|
435
|
434
|
@Test
|
436
|
435
|
public void testEditNickname() {
|
437
|
|
- ProfileManagerModel instance = createModel();
|
|
436
|
+ final ProfileManagerModel instance = createModel();
|
438
|
437
|
final List<String> nicknames = new ArrayList<>(instance.getNicknames());
|
439
|
438
|
final String nickname = nicknames.get(0);
|
440
|
439
|
assertEquals(nicknames, instance.getNicknames());
|
|
@@ -450,7 +449,7 @@ public class ProfileManagerModelTest {
|
450
|
449
|
*/
|
451
|
450
|
@Test
|
452
|
451
|
public void testGetAndSetName() {
|
453
|
|
- ProfileManagerModel instance = createModel();
|
|
452
|
+ final ProfileManagerModel instance = createModel();
|
454
|
453
|
final String name = defaultProfile.getName();
|
455
|
454
|
final String newName = "foo";
|
456
|
455
|
assertEquals(name, instance.getName());
|
|
@@ -463,7 +462,7 @@ public class ProfileManagerModelTest {
|
463
|
462
|
*/
|
464
|
463
|
@Test
|
465
|
464
|
public void testGetAndSetRealname() {
|
466
|
|
- ProfileManagerModel instance = createModel();
|
|
465
|
+ final ProfileManagerModel instance = createModel();
|
467
|
466
|
final String name = "1realname";
|
468
|
467
|
final String newName = "foo";
|
469
|
468
|
assertEquals(name, instance.getRealname());
|
|
@@ -476,7 +475,7 @@ public class ProfileManagerModelTest {
|
476
|
475
|
*/
|
477
|
476
|
@Test
|
478
|
477
|
public void testGetAndSetIdent() {
|
479
|
|
- ProfileManagerModel instance = createModel();
|
|
478
|
+ final ProfileManagerModel instance = createModel();
|
480
|
479
|
final String name = "1ident";
|
481
|
480
|
final String newName = "foo";
|
482
|
481
|
assertEquals(name, instance.getIdent());
|
|
@@ -489,7 +488,7 @@ public class ProfileManagerModelTest {
|
489
|
488
|
*/
|
490
|
489
|
@Test
|
491
|
490
|
public void testIsManipulateProfileAllowed() {
|
492
|
|
- ProfileManagerModel instance = createModel();
|
|
491
|
+ final ProfileManagerModel instance = createModel();
|
493
|
492
|
assertTrue(instance.isManipulateProfileAllowed());
|
494
|
493
|
instance.setProfiles(Arrays.asList(new Profile[]{}));
|
495
|
494
|
assertFalse(instance.isManipulateProfileAllowed());
|
|
@@ -500,7 +499,7 @@ public class ProfileManagerModelTest {
|
500
|
499
|
*/
|
501
|
500
|
@Test
|
502
|
501
|
public void testIsManipulateNicknameAllowed() {
|
503
|
|
- ProfileManagerModel instance = createModel();
|
|
502
|
+ final ProfileManagerModel instance = createModel();
|
504
|
503
|
assertFalse(instance.isManipulateNicknameAllowed());
|
505
|
504
|
instance.setSelectedNickname("1nickname");
|
506
|
505
|
assertTrue(instance.isManipulateNicknameAllowed());
|
|
@@ -512,7 +511,7 @@ public class ProfileManagerModelTest {
|
512
|
511
|
profile.setName("*");
|
513
|
512
|
profile.setRealname("");
|
514
|
513
|
profile.setIdent("*");
|
515
|
|
- ProfileManagerModel instance = createModel();
|
|
514
|
+ final ProfileManagerModel instance = createModel();
|
516
|
515
|
assertTrue(instance.isChangeProfileAllowed());
|
517
|
516
|
instance.setProfiles(Arrays.asList(new Profile[]{profile,}));
|
518
|
517
|
assertFalse(instance.isChangeProfileAllowed());
|
|
@@ -535,7 +534,7 @@ public class ProfileManagerModelTest {
|
535
|
534
|
profile.setName("*");
|
536
|
535
|
profile.setRealname("");
|
537
|
536
|
profile.setIdent("*");
|
538
|
|
- ProfileManagerModel instance = createModel();
|
|
537
|
+ final ProfileManagerModel instance = createModel();
|
539
|
538
|
assertTrue(instance.isOKAllowed());
|
540
|
539
|
instance.setProfiles(Arrays.asList(new Profile[]{}));
|
541
|
540
|
assertFalse(instance.isOKAllowed());
|
|
@@ -556,7 +555,7 @@ public class ProfileManagerModelTest {
|
556
|
555
|
*/
|
557
|
556
|
@Test
|
558
|
557
|
public void testIsNameInValid() {
|
559
|
|
- ProfileManagerModel instance = createModel();
|
|
558
|
+ final ProfileManagerModel instance = createModel();
|
560
|
559
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
561
|
560
|
instance.setName("\\");
|
562
|
561
|
assertTrue(instance.isNameValid().isFailure());
|
|
@@ -567,7 +566,7 @@ public class ProfileManagerModelTest {
|
567
|
566
|
*/
|
568
|
567
|
@Test
|
569
|
568
|
public void testIsNameValid() {
|
570
|
|
- ProfileManagerModel instance = createModel();
|
|
569
|
+ final ProfileManagerModel instance = createModel();
|
571
|
570
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
572
|
571
|
instance.setName("profile");
|
573
|
572
|
assertFalse(instance.isNameValid().isFailure());
|
|
@@ -578,7 +577,7 @@ public class ProfileManagerModelTest {
|
578
|
577
|
*/
|
579
|
578
|
@Test
|
580
|
579
|
public void testIsNicknamesInValid() {
|
581
|
|
- ProfileManagerModel instance = createModel();
|
|
580
|
+ final ProfileManagerModel instance = createModel();
|
582
|
581
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
583
|
582
|
instance.setNicknames(Arrays.asList(new String[]{}));
|
584
|
583
|
assertTrue(instance.isNicknamesValid().isFailure());
|
|
@@ -589,7 +588,7 @@ public class ProfileManagerModelTest {
|
589
|
588
|
*/
|
590
|
589
|
@Test
|
591
|
590
|
public void testIsNicknamesValid() {
|
592
|
|
- ProfileManagerModel instance = createModel();
|
|
591
|
+ final ProfileManagerModel instance = createModel();
|
593
|
592
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
594
|
593
|
instance.setNicknames(Arrays.asList(new String[]{"nickname"}));
|
595
|
594
|
assertFalse(instance.isNicknamesValid().isFailure());
|
|
@@ -600,7 +599,7 @@ public class ProfileManagerModelTest {
|
600
|
599
|
*/
|
601
|
600
|
@Test
|
602
|
601
|
public void testIsRealnameInValid() {
|
603
|
|
- ProfileManagerModel instance = createModel();
|
|
602
|
+ final ProfileManagerModel instance = createModel();
|
604
|
603
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
605
|
604
|
instance.setRealname("");
|
606
|
605
|
assertTrue(instance.isRealnameValid().isFailure());
|
|
@@ -611,7 +610,7 @@ public class ProfileManagerModelTest {
|
611
|
610
|
*/
|
612
|
611
|
@Test
|
613
|
612
|
public void testIsRealnameValid() {
|
614
|
|
- ProfileManagerModel instance = createModel();
|
|
613
|
+ final ProfileManagerModel instance = createModel();
|
615
|
614
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
616
|
615
|
instance.setRealname("realname");
|
617
|
616
|
assertFalse(instance.isRealnameValid().isFailure());
|
|
@@ -622,7 +621,7 @@ public class ProfileManagerModelTest {
|
622
|
621
|
*/
|
623
|
622
|
@Test
|
624
|
623
|
public void testIsIdentInValid() {
|
625
|
|
- ProfileManagerModel instance = createModel();
|
|
624
|
+ final ProfileManagerModel instance = createModel();
|
626
|
625
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
627
|
626
|
instance.setIdent("*");
|
628
|
627
|
assertTrue(instance.isIdentValid().isFailure());
|
|
@@ -633,7 +632,7 @@ public class ProfileManagerModelTest {
|
633
|
632
|
*/
|
634
|
633
|
@Test
|
635
|
634
|
public void testIsIdentValid() {
|
636
|
|
- ProfileManagerModel instance = createModel();
|
|
635
|
+ final ProfileManagerModel instance = createModel();
|
637
|
636
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
638
|
637
|
instance.setIdent("ident");
|
639
|
638
|
assertFalse(instance.isIdentValid().isFailure());
|
|
@@ -644,7 +643,7 @@ public class ProfileManagerModelTest {
|
644
|
643
|
*/
|
645
|
644
|
@Test
|
646
|
645
|
public void testIsIdentValidEmptyString() {
|
647
|
|
- ProfileManagerModel instance = createModel();
|
|
646
|
+ final ProfileManagerModel instance = createModel();
|
648
|
647
|
instance.setProfiles(Arrays.asList(defaultProfile));
|
649
|
648
|
instance.setIdent("");
|
650
|
649
|
assertFalse(instance.isIdentValid().isFailure());
|
|
@@ -655,7 +654,7 @@ public class ProfileManagerModelTest {
|
655
|
654
|
*/
|
656
|
655
|
@Test
|
657
|
656
|
public void testNullSelectedProfileGetters() {
|
658
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
657
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
659
|
658
|
assertTrue("".equals(instance.getSelectedNickname()));
|
660
|
659
|
assertTrue("".equals(instance.getName()));
|
661
|
660
|
assertTrue("".equals(instance.getRealname()));
|
|
@@ -668,7 +667,7 @@ public class ProfileManagerModelTest {
|
668
|
667
|
*/
|
669
|
668
|
@Test
|
670
|
669
|
public void testNullSelectedProfileValidators() {
|
671
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
670
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
672
|
671
|
assertFalse(instance.isNameValid().isFailure());
|
673
|
672
|
assertFalse(instance.isNicknamesValid().isFailure());
|
674
|
673
|
assertFalse(instance.isRealnameValid().isFailure());
|
|
@@ -681,7 +680,7 @@ public class ProfileManagerModelTest {
|
681
|
680
|
@Test
|
682
|
681
|
public void testNullSelectedProfileSetSelectedNickname() {
|
683
|
682
|
final String test = "test";
|
684
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
683
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
685
|
684
|
assertTrue("".equals(instance.getSelectedNickname()));
|
686
|
685
|
instance.setSelectedNickname(test);
|
687
|
686
|
assertTrue("".equals(instance.getSelectedNickname()));
|
|
@@ -693,7 +692,7 @@ public class ProfileManagerModelTest {
|
693
|
692
|
@Test
|
694
|
693
|
public void testNullSelectedProfileSetName() {
|
695
|
694
|
final String test = "test";
|
696
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
695
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
697
|
696
|
assertTrue("".equals(instance.getName()));
|
698
|
697
|
instance.setName(test);
|
699
|
698
|
assertTrue("".equals(instance.getName()));
|
|
@@ -705,7 +704,7 @@ public class ProfileManagerModelTest {
|
705
|
704
|
@Test
|
706
|
705
|
public void testNullSelectedProfileSetRealname() {
|
707
|
706
|
final String test = "test";
|
708
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
707
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
709
|
708
|
assertTrue("".equals(instance.getRealname()));
|
710
|
709
|
instance.setRealname(test);
|
711
|
710
|
assertTrue("".equals(instance.getRealname()));
|
|
@@ -717,7 +716,7 @@ public class ProfileManagerModelTest {
|
717
|
716
|
@Test
|
718
|
717
|
public void testNullSelectedProfileSetIdent() {
|
719
|
718
|
final String test = "test";
|
720
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
719
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
721
|
720
|
assertTrue("".equals(instance.getIdent()));
|
722
|
721
|
instance.setIdent(test);
|
723
|
722
|
assertTrue("".equals(instance.getIdent()));
|
|
@@ -729,7 +728,7 @@ public class ProfileManagerModelTest {
|
729
|
728
|
@Test
|
730
|
729
|
public void testNullSelectedProfileSetNicknames() {
|
731
|
730
|
final String test = "test";
|
732
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
731
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
733
|
732
|
assertTrue(instance.getNicknames().isEmpty());
|
734
|
733
|
instance.setNicknames(Arrays.asList(new String[]{test, }));
|
735
|
734
|
assertTrue(instance.getNicknames().isEmpty());
|
|
@@ -741,7 +740,7 @@ public class ProfileManagerModelTest {
|
741
|
740
|
@Test
|
742
|
741
|
public void testNullSelectedProfileAddNickname() {
|
743
|
742
|
final String test = "test";
|
744
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
743
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
745
|
744
|
assertTrue(instance.getNicknames().isEmpty());
|
746
|
745
|
instance.addNickname(test);
|
747
|
746
|
assertTrue(instance.getNicknames().isEmpty());
|
|
@@ -753,7 +752,7 @@ public class ProfileManagerModelTest {
|
753
|
752
|
@Test
|
754
|
753
|
public void testNullSelectedProfileDeleteNickname() {
|
755
|
754
|
final String test = "test";
|
756
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
755
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
757
|
756
|
assertTrue(instance.getNicknames().isEmpty());
|
758
|
757
|
instance.deleteNickname(test);
|
759
|
758
|
assertTrue(instance.getNicknames().isEmpty());
|
|
@@ -770,7 +769,7 @@ public class ProfileManagerModelTest {
|
770
|
769
|
final Profile second = mock(Profile.class);
|
771
|
770
|
when(first.isDeleted()).thenReturn(false);
|
772
|
771
|
when(second.isDeleted()).thenReturn(true);
|
773
|
|
- ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
|
772
|
+ final ProfileManagerModel instance = new ProfileManagerModel(manager, identityFactory);
|
774
|
773
|
instance.setProfiles(Arrays.asList(new Profile[]{first, second, }));
|
775
|
774
|
instance.save();
|
776
|
775
|
verify(first).save();
|