Upgrade Gradle to 5.6.2 and AGP to 3.5.1

This commit is contained in:
alex-signal
2019-10-17 09:08:24 -03:00
committed by Greyson Parrelli
parent 86d088bce2
commit 9e3475ed94
7 changed files with 68 additions and 8 deletions

View File

@@ -1,15 +1,31 @@
package org.thoughtcrime.securesms.util;
import android.text.TextUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import static junit.framework.Assert.assertEquals;
@RunWith(PowerMockRunner.class)
@PrepareForTest(TextUtils.class)
public class DelimiterUtilTest {
@Before
public void setup() {}
public void setup() {
PowerMockito.mockStatic(TextUtils.class);
PowerMockito.when(TextUtils.isEmpty(Mockito.anyString())).thenAnswer((Answer<Boolean>) invocation -> {
if (invocation.getArguments()[0] == null) return true;
return ((String) invocation.getArguments()[0]).isEmpty();
});
}
@Test
public void testEscape() {