1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Merge branch '4.3'

This commit is contained in:
Florian Schmaus 2018-06-17 14:10:52 +02:00
commit c83f6ec9c8
2 changed files with 17 additions and 1 deletions

View file

@ -72,7 +72,7 @@ public class DNSUtil {
* @param daneProvider
*/
public static void setDaneProvider(SmackDaneProvider daneProvider) {
daneProvider = Objects.requireNonNull(daneProvider);
DNSUtil.daneProvider = Objects.requireNonNull(daneProvider);
}
/**

View file

@ -19,6 +19,8 @@ package org.jivesoftware.smack.util;
import static org.junit.Assert.assertEquals;
import org.jivesoftware.smack.util.DNSUtil.DomainType;
import org.jivesoftware.smack.util.dns.SmackDaneProvider;
import org.jivesoftware.smack.util.dns.SmackDaneVerifier;
import org.junit.Test;
@ -33,4 +35,18 @@ public class DnsUtilTest {
assertEquals(DNSUtil.XMPP_SERVER_DNS_SRV_PREFIX, server.srvPrefix.ace);
}
private static final SmackDaneProvider DNS_UTIL_TEST_DANE_PROVIDER = new SmackDaneProvider() {
@Override
public SmackDaneVerifier newInstance() {
throw new AssertionError();
}
};
@Test
public void daneProviderTest() {
DNSUtil.setDaneProvider(DNS_UTIL_TEST_DANE_PROVIDER);
SmackDaneProvider currentDaneProvider = DNSUtil.getDaneProvider();
assertEquals(DNS_UTIL_TEST_DANE_PROVIDER, currentDaneProvider);
}
}