Browse Source

Merge pull request #139 from csmith/master

Update dependencies.
pull/140/head
Greg Holmes 7 years ago
parent
commit
2be196da00

+ 3
- 3
build.gradle View File

96
     dependencies {
96
     dependencies {
97
         compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
97
         compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
98
         compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.5'
98
         compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.5'
99
-        compile group: 'com.google.auto.value', name: 'auto-value', version: '1.2'
99
+        compile group: 'com.google.auto.value', name: 'auto-value', version: '1.3'
100
 
100
 
101
         compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.21'
101
         compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.21'
102
         compile group: 'com.squareup.dagger', name: 'dagger', version: '1.2.5'
102
         compile group: 'com.squareup.dagger', name: 'dagger', version: '1.2.5'
103
         compile group: 'com.google.guava', name:'guava', version: '19.0'
103
         compile group: 'com.google.guava', name:'guava', version: '19.0'
104
 
104
 
105
-        compile group: 'net.engio', name: 'mbassador', version: '1.2.4.2'
105
+        compile group: 'net.engio', name: 'mbassador', version: '1.3.0'
106
         compile group: 'de.odysseus.juel', name: 'juel-api', version: '2.2.7'
106
         compile group: 'de.odysseus.juel', name: 'juel-api', version: '2.2.7'
107
         compile group: 'de.odysseus.juel', name: 'juel-impl', version: '2.2.7'
107
         compile group: 'de.odysseus.juel', name: 'juel-impl', version: '2.2.7'
108
         compile group: 'de.odysseus.juel', name: 'juel-spi', version: '2.2.7'
108
         compile group: 'de.odysseus.juel', name: 'juel-spi', version: '2.2.7'
109
 
109
 
110
         testCompile group: 'junit', name: 'junit', version: '4.12'
110
         testCompile group: 'junit', name: 'junit', version: '4.12'
111
-        testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19'
111
+        testCompile group: 'org.mockito', name: 'mockito-core', version: '2.2.7'
112
     }
112
     }
113
 
113
 
114
     task publishSnapshot(dependsOn: 'publishMavenJavaPublicationToSnapshotsRepository') << {
114
     task publishSnapshot(dependsOn: 'publishMavenJavaPublicationToSnapshotsRepository') << {

+ 10
- 18
irc/src/test/java/com/dmdirc/parser/irc/IRCReaderTest.java View File

71
         final InputStream stream = new ByteArrayInputStream("te t :foo\r\n".getBytes());
71
         final InputStream stream = new ByteArrayInputStream("te t :foo\r\n".getBytes());
72
         final Encoder encoder = mock(Encoder.class);
72
         final Encoder encoder = mock(Encoder.class);
73
 
73
 
74
-        when(encoder.encode((String) isNull(), (String) isNull(),
75
-                (byte[]) anyObject(), anyInt(), eq(3)))
74
+        when(encoder.encode(isNull(), isNull(),
75
+                anyObject(), anyInt(), eq(3)))
76
                 .thenReturn("encoded");
76
                 .thenReturn("encoded");
77
 
77
 
78
         final IRCReader reader = new IRCReader(stream, encoder);
78
         final IRCReader reader = new IRCReader(stream, encoder);
88
         final InputStream stream = new ByteArrayInputStream("foo bar  baz  :qux  baz\r\n".getBytes());
88
         final InputStream stream = new ByteArrayInputStream("foo bar  baz  :qux  baz\r\n".getBytes());
89
         final Encoder encoder = mock(Encoder.class);
89
         final Encoder encoder = mock(Encoder.class);
90
 
90
 
91
-        when(encoder.encode((String) isNull(), (String) isNull(),
92
-                (byte[]) anyObject(), eq(15), eq(8)))
93
-                .thenReturn("qux  baz");
91
+        when(encoder.encode(isNull(), isNull(), any(), eq(15), eq(8))).thenReturn("qux  baz");
94
 
92
 
95
         final IRCReader reader = new IRCReader(stream, encoder);
93
         final IRCReader reader = new IRCReader(stream, encoder);
96
         final ReadLine line = reader.readLine();
94
         final ReadLine line = reader.readLine();
106
 
104
 
107
         new IRCReader(stream, encoder).readLine();
105
         new IRCReader(stream, encoder).readLine();
108
 
106
 
109
-        verify(encoder).encode(eq("src"), anyString(),
110
-                (byte[]) anyObject(), anyInt(), anyInt());
107
+        verify(encoder).encode(eq("src"), isNull(), any(), anyInt(), anyInt());
111
     }
108
     }
112
 
109
 
113
     /** Verifies that no source is passed if the source is empty. */
110
     /** Verifies that no source is passed if the source is empty. */
118
 
115
 
119
         new IRCReader(stream, encoder).readLine();
116
         new IRCReader(stream, encoder).readLine();
120
 
117
 
121
-        verify(encoder).encode((String) isNull(), anyString(),
122
-                (byte[]) anyObject(), anyInt(), anyInt());
118
+        verify(encoder).encode(isNull(), isNull(), any(), anyInt(), anyInt());
123
     }
119
     }
124
 
120
 
125
     /** Verifies that a destination is extracted properly. */
121
     /** Verifies that a destination is extracted properly. */
130
 
126
 
131
         new IRCReader(stream, encoder).readLine();
127
         new IRCReader(stream, encoder).readLine();
132
 
128
 
133
-        verify(encoder).encode(anyString(), eq("y"), (byte[]) anyObject(),
134
-                anyInt(), anyInt());
129
+        verify(encoder).encode(anyString(), eq("y"), any(), anyInt(), anyInt());
135
     }
130
     }
136
 
131
 
137
     /** Verifies that no destination is extracted if there's no source. */
132
     /** Verifies that no destination is extracted if there's no source. */
142
 
137
 
143
         new IRCReader(stream, encoder).readLine();
138
         new IRCReader(stream, encoder).readLine();
144
 
139
 
145
-        verify(encoder).encode(anyString(), (String) isNull(),
146
-                (byte[]) anyObject(), anyInt(), anyInt());
140
+        verify(encoder).encode(isNull(), isNull(), any(), anyInt(), anyInt());
147
     }
141
     }
148
 
142
 
149
     /** Verifies that no destination is extracted if there are too few args. */
143
     /** Verifies that no destination is extracted if there are too few args. */
154
 
148
 
155
         new IRCReader(stream, encoder).readLine();
149
         new IRCReader(stream, encoder).readLine();
156
 
150
 
157
-        verify(encoder).encode(anyString(), (String) isNull(),
158
-                (byte[]) anyObject(), anyInt(), anyInt());
151
+        verify(encoder).encode(anyString(), isNull(), any(), anyInt(), anyInt());
159
     }
152
     }
160
 
153
 
161
     /** Verifies that a numeric's destination is extracted properly. */
154
     /** Verifies that a numeric's destination is extracted properly. */
166
 
159
 
167
         new IRCReader(stream, encoder).readLine();
160
         new IRCReader(stream, encoder).readLine();
168
 
161
 
169
-        verify(encoder).encode(anyString(), eq("y"), (byte[]) anyObject(), anyInt(), anyInt());
162
+        verify(encoder).encode(anyString(), eq("y"), any(), anyInt(), anyInt());
170
     }
163
     }
171
 
164
 
172
     /** Verifies that the close call is proxied to the stream. */
165
     /** Verifies that the close call is proxied to the stream. */
190
                 (int) '1', (int) ' ', 0xF6, (int) ' ', (int) 'y', (int) ' ', (int) 'z', (int) ' ',
183
                 (int) '1', (int) ' ', 0xF6, (int) ' ', (int) 'y', (int) ' ', (int) 'z', (int) ' ',
191
                 (int) ':', (int) 'x', (int) '\r', (int) '\n');
184
                 (int) ':', (int) 'x', (int) '\r', (int) '\n');
192
 
185
 
193
-        when(encoder.encode(anyString(), anyString(),
194
-                (byte[]) any(), anyInt(), anyInt())).thenReturn("x");
186
+        when(encoder.encode(anyString(), anyString(), any(), anyInt(), anyInt())).thenReturn("x");
195
 
187
 
196
         final ReadLine line = new IRCReader(stream, encoder, Charset.forName("UTF-8")).readLine();
188
         final ReadLine line = new IRCReader(stream, encoder, Charset.forName("UTF-8")).readLine();
197
 
189
 

+ 1
- 1
irc/src/test/java/com/dmdirc/parser/irc/processors/Process001Test.java View File

129
         when(localClient.getNickname()).thenAnswer(invocation -> nickname.toString());
129
         when(localClient.getNickname()).thenAnswer(invocation -> nickname.toString());
130
         doAnswer(invocation -> {
130
         doAnswer(invocation -> {
131
             nickname.setLength(0);
131
             nickname.setLength(0);
132
-            nickname.append(invocation.getArgumentAt(0, String.class));
132
+            nickname.append(invocation.<String>getArgument(0));
133
             return null;
133
             return null;
134
         }).when(localClient).setUserBits(anyString(), eq(true), anyBoolean());
134
         }).when(localClient).setUserBits(anyString(), eq(true), anyBoolean());
135
     }
135
     }

Loading…
Cancel
Save