mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +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
|
* @param daneProvider
|
||||||
*/
|
*/
|
||||||
public static void setDaneProvider(SmackDaneProvider 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 static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import org.jivesoftware.smack.util.DNSUtil.DomainType;
|
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;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -33,4 +35,18 @@ public class DnsUtilTest {
|
||||||
assertEquals(DNSUtil.XMPP_SERVER_DNS_SRV_PREFIX, server.srvPrefix.ace);
|
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