Commit d3a5a159 authored by Isira Seneviratne's avatar Isira Seneviratne

Update Kotlin to 1.4 and update tests accordingly.

parent 24b0860b
......@@ -73,13 +73,13 @@ class MonitorTest {
Mockito.verify(clientInterface).transferOperation(eq(emptyList<Transfer>()), eq(1))
}
@Test(expected = IllegalArgumentException::class)
fun `Expect IllegalArgumentException to be thrown when mBinder's setGlobalPreferences() is called with a null parameter`() {
@Test(expected = NullPointerException::class)
fun `Expect NullPointerException to be thrown when mBinder's setGlobalPreferences() is called with a null parameter`() {
monitor.mBinder.setGlobalPreferences(null)
}
@Test(expected = IllegalArgumentException::class)
fun `Expect IllegalArgumentException to be thrown when mBinder's readAuthToken() is called with a null parameter`() {
@Test(expected = NullPointerException::class)
fun `Expect NullPointerException to be thrown when mBinder's readAuthToken() is called with a null parameter`() {
monitor.mBinder.readAuthToken(null)
}
......
......@@ -81,8 +81,8 @@ public class AccountManagerParserTest {
}
@Test
public void testParser_whenLocalNameIsNull_thenExpectIllegalArgumentExceptionAndEmptyList() {
assertThrows(IllegalArgumentException.class, () ->
public void testParser_whenLocalNameIsNull_thenExpectNullPointerExceptionAndEmptyList() {
assertThrows(NullPointerException.class, () ->
accountManagerParser.startElement(null, null, null, null));
assertTrue(accountManagers.isEmpty());
......
......@@ -51,10 +51,10 @@ public class AccountOutParserTest {
}
@Test
public void testParse_whenRpcStringIsNull_thenExpectIllegalArgumentException() {
public void testParse_whenRpcStringIsNull_thenExpectNullPointerException() {
mockStatic(Xml.class);
assertThrows(IllegalArgumentException.class, () -> AccountOutParser.parse(null));
assertThrows(NullPointerException.class, () -> AccountOutParser.parse(null));
}
@Test(expected = UninitializedPropertyAccessException.class)
......@@ -73,8 +73,8 @@ public class AccountOutParserTest {
assertNull(AccountOutParser.parse(""));
}
@Test(expected = IllegalArgumentException.class)
public void testParser_whenLocalNameIsNull_thenExpectIllegalArgumentException()
@Test(expected = NullPointerException.class)
public void testParser_whenLocalNameIsNull_thenExpectNullPointerException()
throws SAXException {
accountOutParser.startElement(null, null, null, null);
}
......
......@@ -32,7 +32,10 @@ import org.xml.sax.SAXException;
import edu.berkeley.boinc.utils.Logging;
import kotlin.UninitializedPropertyAccessException;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.powermock.api.mockito.PowerMockito.doThrow;
......@@ -52,8 +55,8 @@ public class AcctMgrRPCReplyParserTest {
expected = new AcctMgrRPCReply();
}
@Test(expected = IllegalArgumentException.class)
public void testParse_whenRpcStringIsNull_thenExpectIllegalArgumentException() {
@Test(expected = NullPointerException.class)
public void testParse_whenRpcStringIsNull_thenExpectNullPointerException() {
mockStatic(Xml.class);
AcctMgrRPCReplyParser.parse(null);
......
......@@ -92,8 +92,8 @@ public class HostInfoParserTest {
assertNull(HostInfoParser.parse(""));
}
@Test(expected = IllegalArgumentException.class)
public void testParser_whenLocalNameIsNull_thenExpectIllegalArgumentException() throws SAXException {
@Test(expected = NullPointerException.class)
public void testParser_whenLocalNameIsNull_thenExpectNullPointerException() throws SAXException {
hostInfoParser.startElement(null, null, null, null);
}
......
......@@ -51,8 +51,8 @@ public class MessagesParserTest {
expected = new Message();
}
@Test(expected = IllegalArgumentException.class)
public void testParse_whenRpcResultIsNull_thenExpectIllegalArgumentException() {
@Test(expected = NullPointerException.class)
public void testParse_whenRpcResultIsNull_thenExpectNullPointerException() {
mockStatic(Xml.class);
MessagesParser.parse(null);
......
......@@ -51,7 +51,7 @@ public class NoticesParserTest {
expected = new Notice();
}
@Test(expected = IllegalArgumentException.class)
@Test(expected = NullPointerException.class)
public void testParse_whenRpcStringIsNull_thenExpectNullPointerException() {
mockStatic(Xml.class);
......
......@@ -30,7 +30,10 @@ import org.xml.sax.SAXException;
import kotlin.UninitializedPropertyAccessException;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.powermock.api.mockito.PowerMockito.doThrow;
......@@ -48,8 +51,8 @@ public class ProjectConfigReplyParserTest {
expected = new ProjectConfig();
}
@Test(expected = IllegalArgumentException.class)
public void testParse_whenRpcStringIsNull_thenExpectIllegalArgumentException() {
@Test(expected = NullPointerException.class)
public void testParse_whenRpcStringIsNull_thenExpectNullPointerException() {
mockStatic(Xml.class);
ProjectConfigReplyParser.parse(null);
......
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
ext.kotlin_version = '1.4.0'
repositories {
jcenter()
maven {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment