mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +01:00
Merge branch '4.3'
This commit is contained in:
commit
c83f6ec9c8
2 changed files with 17 additions and 1 deletions
|
@ -72,7 +72,7 @@ public class DNSUtil {
|
|||
* @param daneProvider
|
||||
*/
|
||||
public static void setDaneProvider(SmackDaneProvider daneProvider) {
|
||||
daneProvider = Objects.requireNonNull(daneProvider);
|
||||
DNSUtil.daneProvider = Objects.requireNonNull(daneProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue