Procházet zdrojové kódy

Stop using package private method.

pull/147/head
Greg Holmes před 9 roky
rodič
revize
20d6006a8b

+ 0
- 4
src/com/dmdirc/config/profiles/ProfileManager.java Zobrazit soubor

@@ -93,8 +93,4 @@ public class ProfileManager {
93 93
     public Profile getDefault() {
94 94
         return Iterables.getFirst(profiles, defaultProfile);
95 95
     }
96
-
97
-    Profile getDefaultProfile() {
98
-        return defaultProfile;
99
-    }
100 96
 }

+ 5
- 5
test/com/dmdirc/config/profiles/IdentitiesProfileMigratorTest.java Zobrazit soubor

@@ -77,20 +77,20 @@ public class IdentitiesProfileMigratorTest {
77 77
     }
78 78
 
79 79
     @Test
80
-    public void testNeedsMigration_NoProfiles() throws Exception {
80
+    public void testNeedsMigration_NoProfiles() {
81 81
         when(identityManager.getProvidersByType("profile")).thenReturn(Lists.newArrayList());
82 82
         assertFalse(instance.needsMigration());
83 83
     }
84 84
 
85 85
     @Test
86
-    public void testNeedsMigration_Profiles() throws Exception {
86
+    public void testNeedsMigration_Profiles() {
87 87
         when(identityManager.getProvidersByType("profile")).thenReturn(
88 88
                 Lists.newArrayList(configProvider1));
89 89
         assertTrue(instance.needsMigration());
90 90
     }
91 91
 
92 92
     @Test
93
-    public void testMigrate_NoIdent() throws Exception {
93
+    public void testMigrate_NoIdent() {
94 94
         when(identityManager.getProvidersByType("profile")).thenReturn(
95 95
                 Lists.newArrayList(configProvider1));
96 96
         instance.migrate();
@@ -99,7 +99,7 @@ public class IdentitiesProfileMigratorTest {
99 99
     }
100 100
 
101 101
     @Test
102
-    public void testMigrate_Ident() throws Exception {
102
+    public void testMigrate_Ident() {
103 103
         when(identityManager.getProvidersByType("profile")).thenReturn(
104 104
                 Lists.newArrayList(configProvider2));
105 105
         instance.migrate();
@@ -108,7 +108,7 @@ public class IdentitiesProfileMigratorTest {
108 108
     }
109 109
 
110 110
     @Test
111
-    public void testMigrate_MultipleNicknames() throws Exception {
111
+    public void testMigrate_MultipleNicknames() {
112 112
         when(identityManager.getProvidersByType("profile")).thenReturn(
113 113
                 Lists.newArrayList(configProvider3));
114 114
         instance.migrate();

+ 7
- 1
test/com/dmdirc/config/profiles/ProfileManagerTest.java Zobrazit soubor

@@ -26,6 +26,10 @@ import com.dmdirc.DMDircMBassador;
26 26
 import com.dmdirc.events.ProfileAddedEvent;
27 27
 import com.dmdirc.events.ProfileDeletedEvent;
28 28
 
29
+import com.google.common.collect.Lists;
30
+
31
+import java.util.Optional;
32
+
29 33
 import org.junit.Before;
30 34
 import org.junit.Test;
31 35
 import org.junit.runner.RunWith;
@@ -91,7 +95,9 @@ public class ProfileManagerTest {
91 95
 
92 96
     @Test
93 97
     public void testGetDefaultProfile_EmptyList() {
94
-        assertEquals(instance.getDefaultProfile(), instance.getDefault());
98
+        final String nick = System.getProperty("user.name").replace(' ', '_');
99
+        final Profile profile = new Profile(nick, nick, Optional.empty(), Lists.newArrayList(nick));
100
+        assertEquals(profile, instance.getDefault());
95 101
     }
96 102
 
97 103
     @Test

Načítá se…
Zrušit
Uložit