use of org.junit.jupiter.api.condition.DisabledForJreRange in project dropwizard by dropwizard.
the class HttpsConnectorFactoryTest method testExcludedProtocolsWithWildcards.
@Test
@DisabledForJreRange(min = JRE.JAVA_16)
void testExcludedProtocolsWithWildcards() throws Exception {
List<String> excludedProtocols = Arrays.asList("SSL.*", "TLSv1(\\.[01])?");
HttpsConnectorFactory factory = new HttpsConnectorFactory();
// necessary to avoid a prompt for a password
factory.setKeyStorePassword("password");
factory.setExcludedProtocols(excludedProtocols);
SslContextFactory sslContextFactory = factory.configureSslContextFactory(new SslContextFactory.Server());
assertThat(Arrays.asList(sslContextFactory.getExcludeProtocols())).isEqualTo(excludedProtocols);
sslContextFactory.start();
try {
assertThat(sslContextFactory.newSSLEngine().getEnabledProtocols()).contains("TLSv1.2").allSatisfy(protocol -> assertThat(protocol).doesNotStartWith("SSL")).doesNotContain("TLSv1");
} finally {
sslContextFactory.stop();
}
}
use of org.junit.jupiter.api.condition.DisabledForJreRange in project dropwizard by dropwizard.
the class HttpsConnectorFactoryTest method testExcludedProtocols.
@Test
@DisabledForJreRange(min = JRE.JAVA_16)
void testExcludedProtocols() throws Exception {
List<String> excludedProtocols = Arrays.asList("SSLv3", "TLSv1");
HttpsConnectorFactory factory = new HttpsConnectorFactory();
// necessary to avoid a prompt for a password
factory.setKeyStorePassword("password");
factory.setExcludedProtocols(excludedProtocols);
SslContextFactory sslContextFactory = factory.configureSslContextFactory(new SslContextFactory.Server());
assertThat(Arrays.asList(sslContextFactory.getExcludeProtocols())).isEqualTo(excludedProtocols);
sslContextFactory.start();
try {
assertThat(sslContextFactory.newSSLEngine().getEnabledProtocols()).contains("TLSv1.2").doesNotContain("SSLv3", "TLSv1");
} finally {
sslContextFactory.stop();
}
}
use of org.junit.jupiter.api.condition.DisabledForJreRange in project dropwizard by dropwizard.
the class HttpsConnectorFactoryTest method testExcludedProtocolsWithWildcardsJava16.
@Test
@DisabledForJreRange(max = JRE.JAVA_15)
void testExcludedProtocolsWithWildcardsJava16() throws Exception {
List<String> excludedProtocols = Arrays.asList("SSL.*", "TLSv1(\\.[01])?");
HttpsConnectorFactory factory = new HttpsConnectorFactory();
// necessary to avoid a prompt for a password
factory.setKeyStorePassword("password");
factory.setExcludedProtocols(excludedProtocols);
SslContextFactory sslContextFactory = factory.configureSslContextFactory(new SslContextFactory.Server());
assertThat(Arrays.asList(sslContextFactory.getExcludeProtocols())).isEqualTo(excludedProtocols);
sslContextFactory.start();
try {
assertThat(sslContextFactory.newSSLEngine().getEnabledProtocols()).contains("TLSv1.2", "TLSv1.3").allSatisfy(protocol -> assertThat(protocol).doesNotStartWith("SSL")).doesNotContain("TLSv1");
} finally {
sslContextFactory.stop();
}
}
use of org.junit.jupiter.api.condition.DisabledForJreRange in project spring-data-mongodb by spring-projects.
the class DbRefMappingMongoConverterUnitTests method shouldFallbackToOneByOneFetchingWhenElementsInListOfReferencesPointToDifferentCollections.
// DATAMONGO-1194
@Test
@DisabledForJreRange(min = JRE.JAVA_16, disabledReason = "Class Proxies for eg. ArrayList require to open java.util.")
void shouldFallbackToOneByOneFetchingWhenElementsInListOfReferencesPointToDifferentCollections() {
String id1 = "1";
String id2 = "2";
String value = "val";
MappingMongoConverter converterSpy = spy(converter);
doReturn(new Document("_id", id1).append("value", value)).doReturn(new Document("_id", id2).append("value", value)).when(converterSpy).readRef(Mockito.any(DBRef.class));
Document document = new Document();
ClassWithLazyDbRefs lazyDbRefs = new ClassWithLazyDbRefs();
lazyDbRefs.dbRefToConcreteCollection = new ArrayList<>(Arrays.asList(new LazyDbRefTarget(id1, value), new SerializableLazyDbRefTarget(id2, value)));
converterSpy.write(lazyDbRefs, document);
ClassWithLazyDbRefs result = converterSpy.read(ClassWithLazyDbRefs.class, document);
assertProxyIsResolved(result.dbRefToConcreteCollection, false);
assertThat(result.dbRefToConcreteCollection.get(0).getId()).isEqualTo(id1);
assertProxyIsResolved(result.dbRefToConcreteCollection, true);
assertThat(result.dbRefToConcreteCollection.get(1).getId()).isEqualTo(id2);
verify(converterSpy, times(2)).readRef(Mockito.any(DBRef.class));
verify(converterSpy, never()).bulkReadRefs(anyList());
}
use of org.junit.jupiter.api.condition.DisabledForJreRange in project spring-boot by spring-projects.
the class SpringBootPluginIntegrationTests method failFastWithVersionOfGradle7LowerThanRequired.
@DisabledForJreRange(min = JRE.JAVA_14)
@Test
void failFastWithVersionOfGradle7LowerThanRequired() {
BuildResult result = this.gradleBuild.gradleVersion("7.3.3").buildAndFail();
assertThat(result.getOutput()).contains("Spring Boot plugin requires Gradle 7.x (7.4 or later). The current version is Gradle 7.3.3");
}
Aggregations