conflict_resolution
stringlengths
27
16k
<<<<<<< @SpringBootTest(classes = SampleTomcatWebSocketApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) class SampleWebSocketsApplicationTests { ======= @RunWith(SpringRunner.class) @SpringBootTest(classes = SampleTomcatWebSocketApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) public class SampleWebSocketsApplicationTests { >>>>>>> @SpringBootTest(classes = SampleTomcatWebSocketApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) class SampleWebSocketsApplicationTests { <<<<<<< void echoEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder( ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/echo/websocket") ======= public void echoEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/echo/websocket") >>>>>>> void echoEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/echo/websocket") <<<<<<< void reverseEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder( ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties( "websocket.uri:ws://localhost:" + this.port + "/reverse") ======= public void reverseEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/reverse") >>>>>>> void reverseEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/reverse")
<<<<<<< import org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer.NoSuchMethodDescriptor; import org.springframework.boot.testsupport.classpath.ClassPathOverrides; ======= import org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer.NoSuchMethodDescriptor; import org.springframework.boot.testsupport.runner.classpath.ClassPathOverrides; import org.springframework.boot.testsupport.runner.classpath.ModifiedClassPathRunner; >>>>>>> import org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer.NoSuchMethodDescriptor; import org.springframework.boot.testsupport.classpath.ClassPathOverrides; <<<<<<< void parseJava8ErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations()).isNotEmpty(); assertThat(descriptor.getActualLocation()).asString().contains("servlet-api-2.5.jar"); } @Test void parseJava13OpenJ9ErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "javax/servlet/ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic; (loaded from file..."); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("javax/servlet/ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations()).isNotEmpty(); assertThat(descriptor.getActualLocation()).asString().contains("servlet-api-2.5.jar"); } @Test void parseJava13HotspotErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" + "java.lang.String, javax.servlet.Servlet)'"); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" + "java.lang.String, javax.servlet.Servlet)'"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations()).isNotEmpty(); assertThat(descriptor.getActualLocation()).asString().contains("servlet-api-2.5.jar"); } @Test @EnabledOnJre({ JRE.JAVA_8, JRE.JAVA_11, JRE.JAVA_12 }) void noSuchMethodErrorIsAnalyzedJava8To12() { testNoSuchMethodErrorFailureAnalysis( "javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); } @Test @DisabledOnJre({ JRE.JAVA_8, JRE.JAVA_11, JRE.JAVA_12 }) void noSuchMethodErrorIsAnalyzedJava13AndLater() { testNoSuchMethodErrorFailureAnalysis( "'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" + "java.lang.String, javax.servlet.Servlet)'"); } private void testNoSuchMethodErrorFailureAnalysis(String expectedMethodRepresentation) { ======= public void parseJava8ErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); assertThat(descriptor.getActualLocation().toString()).contains("servlet-api-2.5.jar"); } @Test public void parseJavaOpenJ9ErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "javax/servlet/ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic; (loaded from file..."); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("javax/servlet/ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); assertThat(descriptor.getActualLocation().toString()).contains("servlet-api-2.5.jar"); } @Test public void parseJavaImprovedHotspotErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" + "java.lang.String, javax.servlet.Servlet)'"); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" + "java.lang.String, javax.servlet.Servlet)'"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); assertThat(descriptor.getActualLocation().toString()).contains("servlet-api-2.5.jar"); } @Test public void noSuchMethodErrorIsAnalyzed() { >>>>>>> void parseJava8ErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); assertThat(descriptor.getActualLocation()).asString().contains("servlet-api-2.5.jar"); } @Test void parseJavaOpenJ9ErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "javax/servlet/ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic; (loaded from file..."); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("javax/servlet/ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)" + "Ljavax/servlet/ServletRegistration$Dynamic;"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); assertThat(descriptor.getActualLocation()).asString().contains("servlet-api-2.5.jar"); } @Test void parseJavaImprovedHotspotErrorMessage() { NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( "'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" + "java.lang.String, javax.servlet.Servlet)'"); assertThat(descriptor).isNotNull(); assertThat(descriptor.getErrorMessage()) .isEqualTo("'javax.servlet.ServletRegistration$Dynamic javax.servlet.ServletContext.addServlet(" + "java.lang.String, javax.servlet.Servlet)'"); assertThat(descriptor.getClassName()).isEqualTo("javax.servlet.ServletContext"); assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); assertThat(descriptor.getActualLocation()).asString().contains("servlet-api-2.5.jar"); } @Test void noSuchMethodErrorIsAnalyzed() { <<<<<<< .contains(NoSuchMethodFailureAnalyzerTests.class.getName() + ".createFailure(") .contains(expectedMethodRepresentation).contains("class, javax.servlet.ServletContext,"); ======= .contains(NoSuchMethodFailureAnalyzerTests.class.getName() + ".createFailure(").contains("addServlet(") .contains("class, javax.servlet.ServletContext,"); >>>>>>> .contains(NoSuchMethodFailureAnalyzerTests.class.getName() + ".createFailure(").contains("addServlet(") .contains("class, javax.servlet.ServletContext,");
<<<<<<< @Configuration(proxyBeanMethods = false) ======= @Test public void counterIsIncrementedOncePerEventWithoutCompositeMeterRegistry() { new ApplicationContextRunner() .with(MetricsRun.limitedTo(JmxMetricsExportAutoConfiguration.class)) .withConfiguration( AutoConfigurations.of(LogbackMetricsAutoConfiguration.class)) .run((context) -> { Logger logger = ((LoggerContext) StaticLoggerBinder.getSingleton() .getLoggerFactory()).getLogger("test-logger"); logger.error("Error."); Map<String, MeterRegistry> registriesByName = context .getBeansOfType(MeterRegistry.class); assertThat(registriesByName).hasSize(1); MeterRegistry registry = registriesByName.values().iterator().next(); assertThat(registry.get("logback.events").tag("level", "error") .counter().count()).isEqualTo(1); }); } @Test public void counterIsIncrementedOncePerEventWithCompositeMeterRegistry() { new ApplicationContextRunner() .with(MetricsRun.limitedTo(JmxMetricsExportAutoConfiguration.class, PrometheusMetricsExportAutoConfiguration.class)) .withConfiguration( AutoConfigurations.of(LogbackMetricsAutoConfiguration.class)) .run((context) -> { Logger logger = ((LoggerContext) StaticLoggerBinder.getSingleton() .getLoggerFactory()).getLogger("test-logger"); logger.error("Error."); Map<String, MeterRegistry> registriesByName = context .getBeansOfType(MeterRegistry.class); assertThat(registriesByName).hasSize(3); registriesByName.forEach((name, registry) -> assertThat(registry.get("logback.events") .tag("level", "error").counter().count()) .isEqualTo(1)); }); } @Configuration >>>>>>> @Test public void counterIsIncrementedOncePerEventWithoutCompositeMeterRegistry() { new ApplicationContextRunner() .with(MetricsRun.limitedTo(JmxMetricsExportAutoConfiguration.class)) .withConfiguration( AutoConfigurations.of(LogbackMetricsAutoConfiguration.class)) .run((context) -> { Logger logger = ((LoggerContext) StaticLoggerBinder.getSingleton() .getLoggerFactory()).getLogger("test-logger"); logger.error("Error."); Map<String, MeterRegistry> registriesByName = context .getBeansOfType(MeterRegistry.class); assertThat(registriesByName).hasSize(1); MeterRegistry registry = registriesByName.values().iterator().next(); assertThat(registry.get("logback.events").tag("level", "error") .counter().count()).isEqualTo(1); }); } @Test public void counterIsIncrementedOncePerEventWithCompositeMeterRegistry() { new ApplicationContextRunner() .with(MetricsRun.limitedTo(JmxMetricsExportAutoConfiguration.class, PrometheusMetricsExportAutoConfiguration.class)) .withConfiguration( AutoConfigurations.of(LogbackMetricsAutoConfiguration.class)) .run((context) -> { Logger logger = ((LoggerContext) StaticLoggerBinder.getSingleton() .getLoggerFactory()).getLogger("test-logger"); logger.error("Error."); Map<String, MeterRegistry> registriesByName = context .getBeansOfType(MeterRegistry.class); assertThat(registriesByName).hasSize(3); registriesByName.forEach((name, registry) -> assertThat(registry.get("logback.events") .tag("level", "error").counter().count()) .isEqualTo(1)); }); } @Configuration(proxyBeanMethods = false)
<<<<<<< public void webappResourcesInDirectoriesThatOverlapWithLoaderCanBePackaged() throws IOException { File webappFolder = new File(this.temp, "src/main/webapp"); webappFolder.mkdirs(); ======= public void webappResourcesInDirectoriesThatOverlapWithLoaderCanBePackaged() throws IOException { File webappFolder = this.temp.newFolder("src", "main", "webapp"); >>>>>>> public void webappResourcesInDirectoriesThatOverlapWithLoaderCanBePackaged() throws IOException { File webappFolder = new File(this.temp, "src/main/webapp"); webappFolder.mkdirs(); <<<<<<< executeTask(); assertThat(getEntryNames(getTask().getArchivePath())).containsSubsequence( "WEB-INF/lib/library.jar", "WEB-INF/lib-provided/provided-library.jar"); ======= getTask().execute(); assertThat(getEntryNames(getTask().getArchivePath())).containsSubsequence("WEB-INF/lib/library.jar", "WEB-INF/lib-provided/provided-library.jar"); >>>>>>> executeTask(); assertThat(getEntryNames(getTask().getArchivePath())).containsSubsequence("WEB-INF/lib/library.jar", "WEB-INF/lib-provided/provided-library.jar");
<<<<<<< import co.cask.coopr.client.PluginClient; ======= import co.cask.coopr.codec.json.guice.CodecModules; import co.cask.coopr.client.ProvisionerClient; import co.cask.coopr.client.TenantClient; >>>>>>> import co.cask.coopr.client.PluginClient; import co.cask.coopr.client.ProvisionerClient; import co.cask.coopr.client.TenantClient; import co.cask.coopr.codec.json.guice.CodecModules; <<<<<<< protected static final PluginClient PLUGIN_CLIENT = Mockito.mock(PluginClient.class); protected static final String TEST_PLUGIN_TYPE = "test-plugin-type"; protected static final String TEST_RESOURCE_TYPE = "test-resource-type"; protected static final String TEST_RESOURCE_NAME = "test-resource-name"; protected static final String TEST_RESOURCE_VERSION = "1"; ======= protected static final TenantClient TENANT_CLIENT = Mockito.mock(TenantClient.class); protected static final ProvisionerClient PROVISIONER_CLIENT = Mockito.mock(ProvisionerClient.class); private static final Injector injector = Guice.createInjector( new CodecModules().getModule() ); private static final Gson GSON = injector.getInstance(Gson.class); >>>>>>> protected static final PluginClient PLUGIN_CLIENT = Mockito.mock(PluginClient.class); protected static final String TEST_PLUGIN_TYPE = "test-plugin-type"; protected static final String TEST_RESOURCE_TYPE = "test-resource-type"; protected static final String TEST_RESOURCE_NAME = "test-resource-name"; protected static final String TEST_RESOURCE_VERSION = "1"; protected static final TenantClient TENANT_CLIENT = Mockito.mock(TenantClient.class); protected static final ProvisionerClient PROVISIONER_CLIENT = Mockito.mock(ProvisionerClient.class); private static final Injector injector = Guice.createInjector( new CodecModules().getModule() ); private static final Gson GSON = injector.getInstance(Gson.class); <<<<<<< bind(PluginClient.class).toInstance(PLUGIN_CLIENT); ======= bind(TenantClient.class).toInstance(TENANT_CLIENT); bind(ProvisionerClient.class).toInstance(PROVISIONER_CLIENT); >>>>>>> bind(PluginClient.class).toInstance(PLUGIN_CLIENT); bind(TenantClient.class).toInstance(TENANT_CLIENT); bind(ProvisionerClient.class).toInstance(PROVISIONER_CLIENT);
<<<<<<< import org.springframework.boot.convert.ApplicationConversionService; ======= import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; >>>>>>> import org.springframework.boot.convert.ApplicationConversionService; import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext;
<<<<<<< public void backsOffWithNoDataSourceBeanAndNoLiquibaseUrl() { this.contextRunner.run( (context) -> assertThat(context).doesNotHaveBean(SpringLiquibase.class)); ======= public void noDataSource() { this.contextRunner.run((context) -> assertThat(context).doesNotHaveBean(SpringLiquibase.class)); >>>>>>> public void backsOffWithNoDataSourceBeanAndNoLiquibaseUrl() { this.contextRunner.run((context) -> assertThat(context).doesNotHaveBean(SpringLiquibase.class)); <<<<<<< assertThat(output).doesNotContain(": liquibase:"); ======= assertThat(this.outputCapture.toString()).doesNotContain(": liquibase:"); >>>>>>> assertThat(output).doesNotContain(": liquibase:");
<<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; >>>>>>> import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; <<<<<<< assertThat(map.get("request").toString()).isEqualTo("{Accept=application/json}"); ======= assertEquals("{Accept=application/json}", map.get("request").toString()); verify(request, times(0)).getParameterMap(); >>>>>>> assertThat(map.get("request").toString()).isEqualTo("{Accept=application/json}"); verify(request, times(0)).getParameterMap();
<<<<<<< * Copyright 2012-2018 the original author or authors. ======= * Copyright 2012-2019 the original author or authors. >>>>>>> * Copyright 2012-2019 the original author or authors. <<<<<<< given(repository.findByPrincipalName("user")).willReturn(Collections.emptyMap()); client.get() .uri((builder) -> builder.path("/actuator/sessions") .queryParam("username", "user").build()) .exchange().expectStatus().isOk().expectBody().jsonPath("sessions") .isEmpty(); ======= given(repository.findByIndexNameAndIndexValue(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, "user")).willReturn(Collections.emptyMap()); client.get().uri((builder) -> builder.path("/actuator/sessions").queryParam("username", "user").build()) .exchange().expectStatus().isOk().expectBody().jsonPath("sessions").isEmpty(); >>>>>>> given(repository.findByPrincipalName("user")).willReturn(Collections.emptyMap()); client.get().uri((builder) -> builder.path("/actuator/sessions").queryParam("username", "user").build()) .exchange().expectStatus().isOk().expectBody().jsonPath("sessions").isEmpty(); <<<<<<< given(repository.findByPrincipalName("user")) .willReturn(Collections.singletonMap(session.getId(), session)); client.get() .uri((builder) -> builder.path("/actuator/sessions") .queryParam("username", "user").build()) ======= given(repository.findByIndexNameAndIndexValue(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, "user")).willReturn(Collections.singletonMap(session.getId(), session)); client.get().uri((builder) -> builder.path("/actuator/sessions").queryParam("username", "user").build()) >>>>>>> given(repository.findByPrincipalName("user")).willReturn(Collections.singletonMap(session.getId(), session)); client.get().uri((builder) -> builder.path("/actuator/sessions").queryParam("username", "user").build())
<<<<<<< private final Gson gson; ======= private final QueueGroup clusterQueues; >>>>>>> private final Gson gson; private final QueueGroup clusterQueues; <<<<<<< IdService idService, JsonSerde jsonSerde) { ======= IdService idService, @Named(Constants.Queue.CLUSTER) QueueGroup clusterQueues) { >>>>>>> IdService idService, JsonSerde jsonSerde, @Named(Constants.Queue.CLUSTER) QueueGroup clusterQueues) { <<<<<<< this.gson = jsonSerde.getGson(); ======= this.clusterQueues = clusterQueues; >>>>>>> this.gson = jsonSerde.getGson(); this.clusterQueues = clusterQueues;
<<<<<<< ======= import java.util.Arrays; import java.util.Collections; >>>>>>> import java.util.Collections; <<<<<<< this.changes.clear(); setupWatcher(200, 1); ======= setupWatcher(100, 1); >>>>>>> setupWatcher(100, 1);
<<<<<<< ======= private final JtaProperties jtaProperties; private final TransactionManagerCustomizers transactionManagerCustomizers; BitronixJtaConfiguration(JtaProperties jtaProperties, ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) { this.jtaProperties = jtaProperties; this.transactionManagerCustomizers = transactionManagerCustomizers.getIfAvailable(); } >>>>>>> <<<<<<< public JtaTransactionManager transactionManager(UserTransaction userTransaction, TransactionManager transactionManager, ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) { JtaTransactionManager jtaTransactionManager = new JtaTransactionManager( userTransaction, transactionManager); transactionManagerCustomizers.ifAvailable( (customizers) -> customizers.customize(jtaTransactionManager)); ======= public JtaTransactionManager transactionManager(TransactionManager transactionManager) { JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(transactionManager); if (this.transactionManagerCustomizers != null) { this.transactionManagerCustomizers.customize(jtaTransactionManager); } >>>>>>> public JtaTransactionManager transactionManager(UserTransaction userTransaction, TransactionManager transactionManager, ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) { JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(userTransaction, transactionManager); transactionManagerCustomizers.ifAvailable((customizers) -> customizers.customize(jtaTransactionManager));
<<<<<<< return Objects.hashCode(hostname, ipaddresses, nodenum, hardwaretype, imagetype, flavor, image, sshUser, services, automators); ======= return Objects.hashCode(hostname, ipaddress, nodenum, hardwaretype, imagetype, flavor, image, sshuser, services, automators); >>>>>>> return Objects.hashCode(hostname, ipaddresses, nodenum, hardwaretype, imagetype, flavor, image, sshuser, services, automators);
<<<<<<< @Configuration(proxyBeanMethods = false) @ServletComponentScan( basePackages = "org.springframework.boot.web.servlet.testcomponents") ======= @Configuration @ServletComponentScan(basePackages = "org.springframework.boot.web.servlet.testcomponents") >>>>>>> @Configuration(proxyBeanMethods = false) @ServletComponentScan(basePackages = "org.springframework.boot.web.servlet.testcomponents")
<<<<<<< void testCss() { ResponseEntity<String> entity = this.restTemplate.getForEntity( "http://localhost:" + this.port + "/css/bootstrap.min.css", String.class); ======= public void testCss() { ResponseEntity<String> entity = this.restTemplate .getForEntity("http://localhost:" + this.port + "/css/bootstrap.min.css", String.class); >>>>>>> void testCss() { ResponseEntity<String> entity = this.restTemplate .getForEntity("http://localhost:" + this.port + "/css/bootstrap.min.css", String.class);
<<<<<<< @SpringBootTest(classes = SampleAtmosphereApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) class SampleAtmosphereApplicationTests { ======= @RunWith(SpringRunner.class) @SpringBootTest(classes = SampleAtmosphereApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) public class SampleAtmosphereApplicationTests { >>>>>>> @SpringBootTest(classes = SampleAtmosphereApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) class SampleAtmosphereApplicationTests { <<<<<<< void chatEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder( ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/chat/websocket") ======= public void chatEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/chat/websocket") >>>>>>> void chatEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/chat/websocket")
<<<<<<< * @author Andrew McGhie * @author HaiTao Zhang ======= * @author Rafiullah Hamedy >>>>>>> * @author Andrew McGhie * @author HaiTao Zhang * @author Rafiullah Hamedy <<<<<<< void tomcatBackgroundProcessorDelayMatchesEngineDefault() { ======= public void tomcatMaxHttpFormPostSizeMatchesConnectorDefault() throws Exception { assertThat(this.properties.getTomcat().getMaxHttpFormPostSize().toBytes()) .isEqualTo(getDefaultConnector().getMaxPostSize()); } @Test public void tomcatBackgroundProcessorDelayMatchesEngineDefault() { >>>>>>> void tomcatBackgroundProcessorDelayMatchesEngineDefault() { <<<<<<< void jettyMaxHttpPostSizeMatchesDefault() throws Exception { ======= public void jettyMaxHttpFormPostSizeMatchesDefault() throws Exception { >>>>>>> void jettyMaxHttpFormPostSizeMatchesDefault() throws Exception {
<<<<<<< ======= this.transactionManagerCustomizers = transactionManagerCustomizers.getIfAvailable(); >>>>>>> <<<<<<< private final JpaProperties jpaProperties; ======= private static final Log logger = LogFactory.getLog(JpaWebMvcConfiguration.class); >>>>>>> private final JpaProperties jpaProperties; <<<<<<< @Bean public WebMvcConfigurer openEntityManagerInViewInterceptorConfigurer( OpenEntityManagerInViewInterceptor interceptor) { return new WebMvcConfigurer() { ======= @Bean public OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor() { if (this.jpaProperties.getOpenInView() == null) { logger.warn("spring.jpa.open-in-view is enabled by default. " + "Therefore, database queries may be performed during view " + "rendering. Explicitly configure " + "spring.jpa.open-in-view to disable this warning"); } return new OpenEntityManagerInViewInterceptor(); } >>>>>>> @Bean public WebMvcConfigurer openEntityManagerInViewInterceptorConfigurer( OpenEntityManagerInViewInterceptor interceptor) { return new WebMvcConfigurer() {
<<<<<<< void testGoodbyeProfileFromCommandline(CapturedOutput capturedOutput) { SampleProfileApplication .main(new String[] { "--spring.profiles.active=goodbye" }); assertThat(capturedOutput).contains("Goodbye Everyone"); ======= public void testGoodbyeProfileFromCommandline() throws Exception { SampleProfileApplication.main(new String[] { "--spring.profiles.active=goodbye" }); String output = this.outputCapture.toString(); assertThat(output).contains("Goodbye Everyone"); >>>>>>> void testGoodbyeProfileFromCommandline(CapturedOutput capturedOutput) { SampleProfileApplication.main(new String[] { "--spring.profiles.active=goodbye" }); assertThat(capturedOutput).contains("Goodbye Everyone");
<<<<<<< .withPropertyValues("management.endpoints.web.exposure.include=shutdown") .run((context) -> assertThat(context) .hasSingleBean(ShutdownEndpoint.class)); ======= .run((context) -> assertThat(context).hasSingleBean(ShutdownEndpoint.class)); >>>>>>> .withPropertyValues("management.endpoints.web.exposure.include=shutdown") .run((context) -> assertThat(context).hasSingleBean(ShutdownEndpoint.class));
<<<<<<< ======= @Override public Statement apply(Statement base, Description description) { try { DockerClientFactory.instance().client(); } catch (Throwable ex) { return new SkipStatement(); } this.container = this.containerFactory.get(); return ((FailureDetectingExternalResource) this.container).apply(base, description); } >>>>>>> <<<<<<< private boolean isDockerRunning() { try { DockerClientFactory.instance().client(); return true; ======= @Override public void evaluate() { throw new AssumptionViolatedException("Could not find a valid Docker environment."); >>>>>>> private boolean isDockerRunning() { try { DockerClientFactory.instance().client(); return true;
<<<<<<< assertThatIllegalArgumentException() .isThrownBy(() -> new DefaultApplicationArguments((String[]) null)) ======= assertThatIllegalArgumentException().isThrownBy(() -> new DefaultApplicationArguments(null)) >>>>>>> assertThatIllegalArgumentException().isThrownBy(() -> new DefaultApplicationArguments((String[]) null)) <<<<<<< ApplicationArguments arguments = new DefaultApplicationArguments("--debug"); ======= ApplicationArguments arguments = new DefaultApplicationArguments(new String[] { "--debug" }); >>>>>>> ApplicationArguments arguments = new DefaultApplicationArguments("--debug");
<<<<<<< public ErrorMvcAutoConfiguration(ServerProperties serverProperties) { ======= private final DispatcherServletPath dispatcherServletPath; private final List<ErrorViewResolver> errorViewResolvers; public ErrorMvcAutoConfiguration(ServerProperties serverProperties, DispatcherServletPath dispatcherServletPath, ObjectProvider<ErrorViewResolver> errorViewResolvers) { >>>>>>> public ErrorMvcAutoConfiguration(ServerProperties serverProperties) { <<<<<<< ======= this.dispatcherServletPath = dispatcherServletPath; this.errorViewResolvers = errorViewResolvers.orderedStream().collect(Collectors.toList()); >>>>>>> <<<<<<< @ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT) public BasicErrorController basicErrorController(ErrorAttributes errorAttributes, ObjectProvider<ErrorViewResolver> errorViewResolvers) { return new BasicErrorController(errorAttributes, this.serverProperties.getError(), errorViewResolvers.orderedStream().collect(Collectors.toList())); ======= @ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT) public BasicErrorController basicErrorController(ErrorAttributes errorAttributes) { return new BasicErrorController(errorAttributes, this.serverProperties.getError(), this.errorViewResolvers); >>>>>>> @ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT) public BasicErrorController basicErrorController(ErrorAttributes errorAttributes, ObjectProvider<ErrorViewResolver> errorViewResolvers) { return new BasicErrorController(errorAttributes, this.serverProperties.getError(), errorViewResolvers.orderedStream().collect(Collectors.toList())); <<<<<<< @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(prefix = "server.error.whitelabel", name = "enabled", matchIfMissing = true) ======= @Configuration @ConditionalOnProperty(prefix = "server.error.whitelabel", name = "enabled", matchIfMissing = true) >>>>>>> @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(prefix = "server.error.whitelabel", name = "enabled", matchIfMissing = true)
<<<<<<< import org.n52.iceland.encode.EncoderKey; import org.n52.iceland.encode.OperationEncoderKey; import org.n52.iceland.encode.XmlEncoderKey; ======= import org.n52.iceland.coding.CodingRepository; import org.n52.iceland.coding.encode.EncoderKey; import org.n52.iceland.coding.encode.OperationEncoderKey; import org.n52.iceland.coding.encode.XmlEncoderKey; import org.n52.iceland.config.SettingsManager; import org.n52.iceland.exception.ows.OwsExceptionReport; >>>>>>> import org.n52.iceland.coding.encode.EncoderKey; import org.n52.iceland.coding.encode.OperationEncoderKey; import org.n52.iceland.coding.encode.XmlEncoderKey; import org.n52.iceland.exception.ows.OwsExceptionReport;
<<<<<<< this.webTestClient.get().uri("/").exchange().expectStatus().is2xxSuccessful() .expectBody().consumeWith(document("default-snippets")); File defaultSnippetsDir = new File(this.generatedSnippets, "default-snippets"); ======= this.webTestClient.get().uri("/").exchange().expectStatus().is2xxSuccessful().expectBody() .consumeWith(document("default-snippets")); File defaultSnippetsDir = new File("target/generated-snippets/default-snippets"); >>>>>>> this.webTestClient.get().uri("/").exchange().expectStatus().is2xxSuccessful().expectBody() .consumeWith(document("default-snippets")); File defaultSnippetsDir = new File(this.generatedSnippets, "default-snippets"); <<<<<<< assertThat(contentOf(new File(defaultSnippetsDir, "curl-request.adoc"))) .contains("'https://api.example.com/'"); assertThat(contentOf(new File(defaultSnippetsDir, "http-request.adoc"))) .contains("api.example.com"); ======= assertThat(new File(defaultSnippetsDir, "curl-request.adoc")) .has(contentContaining("'https://api.example.com/'")); assertThat(new File(defaultSnippetsDir, "http-request.adoc")).has(contentContaining("api.example.com")); >>>>>>> assertThat(contentOf(new File(defaultSnippetsDir, "curl-request.adoc"))).contains("'https://api.example.com/'"); assertThat(contentOf(new File(defaultSnippetsDir, "http-request.adoc"))).contains("api.example.com");
<<<<<<< private QueueService queueService; ======= // Authentication private boolean securityEnabled; private ExternalAuthenticationServer externalAuthenticationServer; >>>>>>> private QueueService queueService; // Authentication private boolean securityEnabled; private ExternalAuthenticationServer externalAuthenticationServer; <<<<<<< queueService = injector.getInstance(QueueService.class); queueService.startAndWait(); ======= if (securityEnabled) { externalAuthenticationServer = injector.getInstance(ExternalAuthenticationServer.class); externalAuthenticationServer.startAndWait(); } >>>>>>> queueService = injector.getInstance(QueueService.class); queueService.startAndWait(); if (securityEnabled) { externalAuthenticationServer = injector.getInstance(ExternalAuthenticationServer.class); externalAuthenticationServer.startAndWait(); } <<<<<<< stopAll(handlerServer, queueService, credentialStore, userStore, resourceService, provisionerStore, tenantStore, clusterStoreService, entityStoreService, idService, zkClientService, inMemoryZKServer); ======= stopAll(internalHandlerServer, externalHandlerServer, userStore, resourceService, provisionerStore, tenantStore, clusterStoreService, entityStoreService, idService, zkClientService, inMemoryZKServer, externalAuthenticationServer); >>>>>>> stopAll(internalHandlerServer, externalHandlerServer, queueService, userStore, resourceService, provisionerStore, tenantStore, clusterStoreService, entityStoreService, idService, zkClientService, inMemoryZKServer, externalAuthenticationServer);
<<<<<<< private Resource[] findResources(File outputDir) throws IOException { return ResourcePatternUtils .getResourcePatternResolver(new DefaultResourceLoader()) .getResources("file:" + outputDir.getAbsolutePath() + "/*.txt"); ======= private Resource[] findResources() throws IOException { return ResourcePatternUtils.getResourcePatternResolver(new DefaultResourceLoader()) .getResources("file:target/output/*.txt"); >>>>>>> private Resource[] findResources(File outputDir) throws IOException { return ResourcePatternUtils.getResourcePatternResolver(new DefaultResourceLoader()) .getResources("file:" + outputDir.getAbsolutePath() + "/*.txt");
<<<<<<< void autoConfigurationConditionalOnClassFlux() { ======= public void securityWebFilterChainBeanConditionalOnWebApplication() { this.contextRunner.withUserConfiguration(ReactiveOAuth2AuthorizedClientRepositoryConfiguration.class) .run((context) -> assertThat(context).doesNotHaveBean(SecurityWebFilterChain.class)); } @Test public void configurationRegistersSecurityWebFilterChainBean() { // gh-17949 new ReactiveWebApplicationContextRunner() .withConfiguration(AutoConfigurations.of(ReactiveOAuth2ClientAutoConfiguration.class)) .withUserConfiguration(ReactiveOAuth2AuthorizedClientServiceConfiguration.class, ServerHttpSecurityConfiguration.class) .run((context) -> assertThat(getFilters(context, OAuth2LoginAuthenticationWebFilter.class)) .isNotNull()); } @Test public void autoConfigurationConditionalOnClassFlux() { >>>>>>> void securityWebFilterChainBeanConditionalOnWebApplication() { this.contextRunner.withUserConfiguration(ReactiveOAuth2AuthorizedClientRepositoryConfiguration.class) .run((context) -> assertThat(context).doesNotHaveBean(SecurityWebFilterChain.class)); } @Test void configurationRegistersSecurityWebFilterChainBean() { // gh-17949 new ReactiveWebApplicationContextRunner() .withConfiguration(AutoConfigurations.of(ReactiveOAuth2ClientAutoConfiguration.class)) .withUserConfiguration(ReactiveOAuth2AuthorizedClientServiceConfiguration.class, ServerHttpSecurityConfiguration.class) .run((context) -> assertThat(getFilters(context, OAuth2LoginAuthenticationWebFilter.class)) .isNotNull()); } @Test void autoConfigurationConditionalOnClassFlux() { <<<<<<< @Configuration(proxyBeanMethods = false) ======= @SuppressWarnings("unchecked") private List<WebFilter> getFilters(AssertableReactiveWebApplicationContext context, Class<? extends WebFilter> filter) { SecurityWebFilterChain filterChain = (SecurityWebFilterChain) context .getBean(BeanIds.SPRING_SECURITY_FILTER_CHAIN); List<WebFilter> filters = (List<WebFilter>) ReflectionTestUtils.getField(filterChain, "filters"); return filters.stream().filter(filter::isInstance).collect(Collectors.toList()); } @Configuration >>>>>>> @SuppressWarnings("unchecked") private List<WebFilter> getFilters(AssertableReactiveWebApplicationContext context, Class<? extends WebFilter> filter) { SecurityWebFilterChain filterChain = (SecurityWebFilterChain) context .getBean(BeanIds.SPRING_SECURITY_FILTER_CHAIN); List<WebFilter> filters = (List<WebFilter>) ReflectionTestUtils.getField(filterChain, "filters"); return filters.stream().filter(filter::isInstance).collect(Collectors.toList()); } @Configuration(proxyBeanMethods = false)
<<<<<<< @SpringBootTest( classes = { SampleJettyWebSocketsApplication.class, CustomContainerConfiguration.class }, ======= @RunWith(SpringRunner.class) @SpringBootTest(classes = { SampleJettyWebSocketsApplication.class, CustomContainerConfiguration.class }, >>>>>>> @SpringBootTest(classes = { SampleJettyWebSocketsApplication.class, CustomContainerConfiguration.class }, <<<<<<< void echoEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder( ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/ws/echo/websocket") ======= public void echoEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/ws/echo/websocket") >>>>>>> void echoEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/ws/echo/websocket") <<<<<<< void reverseEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder( ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/ws/reverse") ======= public void reverseEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/ws/reverse") >>>>>>> void reverseEndpoint() { ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) .properties("websocket.uri:ws://localhost:" + this.port + "/ws/reverse")
<<<<<<< * @author Phillip Webb ======= * @author Andy Wilkinson >>>>>>> * @author Phillip Webb * @author Andy Wilkinson <<<<<<< @Test public void loggingThatUsesJulIsCaptured() { this.loggingSystem.beforeInitialize(); this.loggingSystem.initialize(null, null); java.util.logging.Logger julLogger = java.util.logging.Logger .getLogger(getClass().getName()); julLogger.info("Hello world"); String output = this.output.toString().trim(); assertTrue("Wrong output:\n" + output, output.contains("Hello world")); } ======= @Test public void jbossLoggingIsConfiguredToUseSlf4j() { this.loggingSystem.beforeInitialize(); assertEquals("slf4j", System.getProperty("org.jboss.logging.provider")); } >>>>>>> @Test public void loggingThatUsesJulIsCaptured() { this.loggingSystem.beforeInitialize(); this.loggingSystem.initialize(null, null); java.util.logging.Logger julLogger = java.util.logging.Logger .getLogger(getClass().getName()); julLogger.info("Hello world"); String output = this.output.toString().trim(); assertTrue("Wrong output:\n" + output, output.contains("Hello world")); } @Test public void jbossLoggingIsConfiguredToUseSlf4j() { this.loggingSystem.beforeInitialize(); assertEquals("slf4j", System.getProperty("org.jboss.logging.provider")); }
<<<<<<< import java.util.Locale; import org.springframework.beans.factory.annotation.Value; ======= import java.util.LinkedHashMap; import java.util.Map; >>>>>>> import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; import org.springframework.beans.factory.annotation.Value; <<<<<<< /** * If a "NoHandlerFoundException" should be thrown if no Handler was found to process * a request. */ private boolean throwExceptionIfNoHandlerFound = false; private final Async async = new Async(); private final View view = new View(); ======= /** * Maps file extensions to media types for content negotiation, e.g. yml->text/yaml. */ private Map<String, MediaType> mediaTypes = new LinkedHashMap<String, MediaType>(); >>>>>>> /** * If a "NoHandlerFoundException" should be thrown if no Handler was found to process * a request. */ private boolean throwExceptionIfNoHandlerFound = false; private final Async async = new Async(); private final View view = new View(); /** * Maps file extensions to media types for content negotiation, e.g. yml->text/yaml. */ private Map<String, MediaType> mediaTypes = new LinkedHashMap<String, MediaType>(); <<<<<<< public boolean isThrowExceptionIfNoHandlerFound() { return this.throwExceptionIfNoHandlerFound; } public void setThrowExceptionIfNoHandlerFound( boolean throwExceptionIfNoHandlerFound) { this.throwExceptionIfNoHandlerFound = throwExceptionIfNoHandlerFound; } public Async getAsync() { return this.async; } public View getView() { return this.view; } public static class Async { /** * Amount of time (in milliseconds) before asynchronous request handling times * out. If this value is not set, the default timeout of the underlying * implementation is used, e.g. 10 seconds on Tomcat with Servlet 3. */ private Long requestTimeout; public Long getRequestTimeout() { return this.requestTimeout; } public void setRequestTimeout(Long requestTimeout) { this.requestTimeout = requestTimeout; } } public static class View { /** * Spring MVC view prefix. */ @Value("${spring.view.prefix:}") private String prefix; /** * Spring MVC view suffix. */ @Value("${spring.view.suffix:}") private String suffix; public String getPrefix() { return this.prefix; } public void setPrefix(String prefix) { this.prefix = prefix; } public String getSuffix() { return this.suffix; } public void setSuffix(String suffix) { this.suffix = suffix; } } ======= public Map<String, MediaType> getMediaTypes() { return this.mediaTypes; } public void setMediaTypes(Map<String, MediaType> mediaTypes) { this.mediaTypes = mediaTypes; } >>>>>>> public boolean isThrowExceptionIfNoHandlerFound() { return this.throwExceptionIfNoHandlerFound; } public void setThrowExceptionIfNoHandlerFound( boolean throwExceptionIfNoHandlerFound) { this.throwExceptionIfNoHandlerFound = throwExceptionIfNoHandlerFound; } public Async getAsync() { return this.async; } public View getView() { return this.view; } public Map<String, MediaType> getMediaTypes() { return this.mediaTypes; } public void setMediaTypes(Map<String, MediaType> mediaTypes) { this.mediaTypes = mediaTypes; } public static class Async { /** * Amount of time (in milliseconds) before asynchronous request handling times * out. If this value is not set, the default timeout of the underlying * implementation is used, e.g. 10 seconds on Tomcat with Servlet 3. */ private Long requestTimeout; public Long getRequestTimeout() { return this.requestTimeout; } public void setRequestTimeout(Long requestTimeout) { this.requestTimeout = requestTimeout; } } public static class View { /** * Spring MVC view prefix. */ @Value("${spring.view.prefix:}") private String prefix; /** * Spring MVC view suffix. */ @Value("${spring.view.suffix:}") private String suffix; public String getPrefix() { return this.prefix; } public void setPrefix(String prefix) { this.prefix = prefix; } public String getSuffix() { return this.suffix; } public void setSuffix(String suffix) { this.suffix = suffix; } }
<<<<<<< * @author Artsiom Yudovin ======= * @since 1.5.0 >>>>>>> * @author Artsiom Yudovin * @since 1.5.0
<<<<<<< * Copyright 2012-2018 the original author or authors. ======= * Copyright 2012-2019 the original author or authors. >>>>>>> * Copyright 2012-2019 the original author or authors. <<<<<<< MongoOperationsSessionRepository repository = validateSessionRepository( context, MongoOperationsSessionRepository.class); assertThat(repository).hasFieldOrPropertyWithValue("collectionName", collectionName); ======= MongoOperationsSessionRepository repository = validateSessionRepository(context, MongoOperationsSessionRepository.class); assertThat(new DirectFieldAccessor(repository).getPropertyValue("collectionName")) .isEqualTo(collectionName); >>>>>>> MongoOperationsSessionRepository repository = validateSessionRepository(context, MongoOperationsSessionRepository.class); assertThat(repository).hasFieldOrPropertyWithValue("collectionName", collectionName);
<<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; >>>>>>> import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock;
<<<<<<< import org.bcia.javachain.msp.mgmt.Principal; import org.bcia.javachain.protos.common.MspPrincipal; import org.junit.Assert; ======= >>>>>>> <<<<<<< IMspPrincipalGetter principalGetter1 = new Principal(); PolicyChecker policyChecker = new PolicyChecker(new ChannelPolicyManager(),mspManager,principalGetter1); policyChecker.checkPolicyNoChannel(reader,new SignedProposal("Alicesaaa".getBytes(),"msg1".getBytes())); ======= PolicyChecker policyChecker = new PolicyChecker(new GroupPolicyManager(),mspManager,principalGetter); //SignedProposal signedProposal = new SignedProposal("Alicesaaa".getBytes(),"msg1".getBytes()); //policyChecker.checkPolicyNoGroup(reader,signedProposal); >>>>>>> PolicyChecker policyChecker = new PolicyChecker(new GroupPolicyManager(),mspManager,principalGetter);
<<<<<<< assertThat(source.getProperties()).hasSize(1); ConfigurationMetadataSource source2 = group.getSources() .get("org.acme.Bar"); ======= assertEquals(1, source.getProperties().size()); ConfigurationMetadataSource source2 = group.getSources().get("org.acme.Bar"); >>>>>>> assertThat(source.getProperties()).hasSize(1); ConfigurationMetadataSource source2 = group.getSources().get("org.acme.Bar");
<<<<<<< this.initializer.onApplicationEvent( new ApplicationStartingEvent(new SpringApplication(), NO_ARGS)); ======= multicastEvent(new ApplicationStartedEvent(new SpringApplication(), NO_ARGS)); >>>>>>> multicastEvent(new ApplicationStartingEvent(new SpringApplication(), NO_ARGS)); <<<<<<< this.initializer.onApplicationEvent(new ApplicationStartingEvent( this.springApplication, new String[] { "--debug" })); ======= multicastEvent(new ApplicationStartedEvent(this.springApplication, new String[] { "--debug" })); >>>>>>> multicastEvent(new ApplicationStartingEvent(this.springApplication, new String[] { "--debug" })); <<<<<<< listener.onApplicationEvent( new ApplicationStartingEvent(new SpringApplication(), NO_ARGS)); ======= multicastEvent(listener, new ApplicationStartedEvent(new SpringApplication(), NO_ARGS)); >>>>>>> multicastEvent(listener, new ApplicationStartingEvent(new SpringApplication(), NO_ARGS)); <<<<<<< listener.onApplicationEvent( new ApplicationStartingEvent(new SpringApplication(), NO_ARGS)); ======= multicastEvent(listener, new ApplicationStartedEvent(new SpringApplication(), NO_ARGS)); >>>>>>> multicastEvent(listener, new ApplicationStartingEvent(new SpringApplication(), NO_ARGS)); <<<<<<< this.initializer.onApplicationEvent( new ApplicationStartingEvent(this.springApplication, new String[0])); ======= multicastEvent( new ApplicationStartedEvent(this.springApplication, new String[0])); >>>>>>> multicastEvent( new ApplicationStartingEvent(this.springApplication, new String[0])); <<<<<<< this.initializer.onApplicationEvent( new ApplicationStartingEvent(this.springApplication, new String[0])); ======= multicastEvent( new ApplicationStartedEvent(this.springApplication, new String[0])); >>>>>>> multicastEvent( new ApplicationStartingEvent(this.springApplication, new String[0])); <<<<<<< this.initializer.onApplicationEvent( new ApplicationStartingEvent(this.springApplication, new String[0])); ======= multicastEvent( new ApplicationStartedEvent(this.springApplication, new String[0])); >>>>>>> multicastEvent( new ApplicationStartingEvent(this.springApplication, new String[0]));
<<<<<<< Provider provider = createProvider(); provider.setUserInfoAuthenticationMethod("form"); OAuth2ClientProperties.Registration registration = createRegistration("provider"); ======= Provider provider = new Provider(); provider.setAuthorizationUri("https://example.com/auth"); provider.setTokenUri("https://example.com/token"); provider.setUserInfoUri("https://example.com/info"); provider.setUserNameAttribute("sub"); provider.setJwkSetUri("https://example.com/jwk"); Registration registration = new Registration(); registration.setProvider("provider"); registration.setClientId("clientId"); registration.setClientSecret("clientSecret"); registration.setClientAuthenticationMethod("post"); registration.setAuthorizationGrantType("authorization_code"); registration.setRedirectUriTemplate("https://example.com/redirect"); registration.setScope(Collections.singleton("scope")); >>>>>>> Provider provider = createProvider(); provider.setUserInfoAuthenticationMethod("form"); OAuth2ClientProperties.Registration registration = createRegistration("provider"); <<<<<<< OAuth2ClientProperties.Registration registration = createRegistration("google"); ======= Registration registration = new Registration(); registration.setProvider("google"); registration.setClientId("clientId"); registration.setClientSecret("clientSecret"); registration.setClientAuthenticationMethod("post"); registration.setAuthorizationGrantType("authorization_code"); registration.setRedirectUriTemplate("https://example.com/redirect"); registration.setScope(Collections.singleton("scope")); >>>>>>> OAuth2ClientProperties.Registration registration = createRegistration("google"); <<<<<<< .isEqualTo("http://example.com/redirect"); assertThat(adapted.getScopes()).containsExactly("user"); ======= .isEqualTo("https://example.com/redirect"); assertThat(adapted.getScopes()).containsExactly("scope"); >>>>>>> .isEqualTo("https://example.com/redirect"); assertThat(adapted.getScopes()).containsExactly("user");
<<<<<<< * Copyright 2012-2018 the original author or authors. ======= * Copyright 2012-2019 the original author or authors. >>>>>>> * Copyright 2012-2019 the original author or authors. <<<<<<< context.setClassLoader(new FilteredClassLoader(EmbeddedDriver.class)); TestPropertyValues.of(environment) .and("spring.datasource.initialization-mode=never").applyTo(context); ======= TestPropertyValues.of(environment).and("spring.datasource.initialization-mode=never").applyTo(context); >>>>>>> context.setClassLoader(new FilteredClassLoader(EmbeddedDriver.class)); TestPropertyValues.of(environment).and("spring.datasource.initialization-mode=never").applyTo(context);
<<<<<<< String urlMapping = path + (path.endsWith("/") ? "*" : "/*"); ServletRegistrationBean<WebServlet> registration = new ServletRegistrationBean<>( new WebServlet(), urlMapping); ======= String urlMapping = path.endsWith("/") ? path + "*" : path + "/*"; ServletRegistrationBean<WebServlet> registration = new ServletRegistrationBean<>(new WebServlet(), urlMapping); >>>>>>> String urlMapping = path + (path.endsWith("/") ? "*" : "/*"); ServletRegistrationBean<WebServlet> registration = new ServletRegistrationBean<>(new WebServlet(), urlMapping);
<<<<<<< given(redisConnection.closeLater()).willReturn(Mono.empty()); RedisReactiveHealthIndicator healthIndicator = createHealthIndicator( redisConnection, commands); ======= RedisReactiveHealthIndicator healthIndicator = createHealthIndicator(redisConnection, commands); >>>>>>> given(redisConnection.closeLater()).willReturn(Mono.empty()); RedisReactiveHealthIndicator healthIndicator = createHealthIndicator(redisConnection, commands);
<<<<<<< import org.springframework.beans.factory.SmartInitializingSingleton; ======= import org.springframework.beans.factory.NoSuchBeanDefinitionException; >>>>>>> import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.SmartInitializingSingleton; <<<<<<< import org.springframework.context.ApplicationContext; ======= import org.springframework.context.ApplicationListener; >>>>>>> import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener;
<<<<<<< void defaultPropertyAsFallback() { this.environment.getPropertySources().addLast( new MapPropertySource("defaultProperties", Collections.singletonMap("my.fallback", (Object) "foo"))); ======= public void defaultPropertyAsFallback() { this.environment.getPropertySources() .addLast(new MapPropertySource("defaultProperties", Collections.singletonMap("my.fallback", "foo"))); >>>>>>> void defaultPropertyAsFallback() { this.environment.getPropertySources() .addLast(new MapPropertySource("defaultProperties", Collections.singletonMap("my.fallback", "foo")));
<<<<<<< import java.util.Iterator; ======= import java.util.List; import java.util.regex.Pattern; import org.json.JSONArray; import org.json.JSONObject; >>>>>>> import java.util.Iterator; import java.util.List; <<<<<<< ======= /** * to remember larger sets of thoughts, we can also think arguments * @param argument * @return self, the current argument */ public SusiArgument think(SusiArgument argument) { argument.recall.forEach(thought -> think(thought)); return this; } private static final Pattern variable_pattern = Pattern.compile("\\$.*?\\$"); >>>>>>> /** * to remember larger sets of thoughts, we can also think arguments * @param argument * @return self, the current argument */ public SusiArgument think(SusiArgument argument) { argument.recall.forEach(thought -> think(thought)); return this; } <<<<<<< for (SusiThought t: this) { String s = t.unify(statement); if (s == null) break; // no more patterns to be instantiated left, not an error! statement = s; ======= remember: for (int mindstate_count = this.recall.size() - 1; mindstate_count >= 0; mindstate_count--) { JSONArray table = this.recall.get(mindstate_count).getData(); if (table != null && table.length() > 0) { JSONObject row = table.getJSONObject(0); for (String key: row.keySet()) { int i = statement.indexOf("$" + key + "$"); if (i >= 0) { statement = statement.substring(0, i) + row.get(key).toString() + statement.substring(i + key.length() + 2); } } if (!variable_pattern.matcher(statement).find()) break remember; //termination if no more patterns are included in statement } >>>>>>> for (SusiThought t: this) { statement = t.unify(statement); if (!SusiThought.variable_pattern.matcher(statement).find()) return statement; <<<<<<< /** * the iterator returns the thoughts in reverse order, latest thought first */ @Override public Iterator<SusiThought> iterator() { return new Iterator<SusiThought>() { private int p = recall.size(); @Override public boolean hasNext() {return p > 0;} @Override public SusiThought next() {return remember(--p);} }; } ======= /** * Every argument may have a set of (re-)actions assigned. * Those (re-)actions are methods to do something with the argument. * @param action one (re-)action on this argument * @return the argument */ public SusiArgument addAction(final SusiAction action) { this.actions.add(action); return this; } /** * To be able to apply (re-)actions to this thought, the actions on the information can be retrieved. * @return the (re-)actions which are applicable to this thought. */ public List<SusiAction> getActions() { return this.actions; } >>>>>>> /** * the iterator returns the thoughts in reverse order, latest thought first */ @Override public Iterator<SusiThought> iterator() { return new Iterator<SusiThought>() { private int p = recall.size(); @Override public boolean hasNext() {return p > 0;} @Override public SusiThought next() {return recall.get(--p);} }; } /** * Every argument may have a set of (re-)actions assigned. * Those (re-)actions are methods to do something with the argument. * @param action one (re-)action on this argument * @return the argument */ public SusiArgument addAction(final SusiAction action) { this.actions.add(action); return this; } /** * To be able to apply (re-)actions to this thought, the actions on the information can be retrieved. * @return the (re-)actions which are applicable to this thought. */ public List<SusiAction> getActions() { return this.actions; } public static void main(String[] args) { SusiArgument a = new SusiArgument().think(new SusiThought().addObservation("a", "letter-a")); System.out.println(a.unify("the letter $a$")); }
<<<<<<< ======= * {@link LifecycleListener} that stores an empty merged web.xml. This is critical for * Jasper on Tomcat 7 to prevent warnings about missing web.xml files and to enable * EL. */ private static class StoreMergedWebXmlListener implements LifecycleListener { private static final String MERGED_WEB_XML = "org.apache.tomcat.util.scan.MergedWebXml"; @Override public void lifecycleEvent(LifecycleEvent event) { if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) { onStart((Context) event.getLifecycle()); } } private void onStart(Context context) { ServletContext servletContext = context.getServletContext(); if (servletContext.getAttribute(MERGED_WEB_XML) == null) { servletContext.setAttribute(MERGED_WEB_XML, getEmptyWebXml()); } } private String getEmptyWebXml() { InputStream stream = TomcatEmbeddedServletContainerFactory.class .getResourceAsStream("empty-web.xml"); Assert.state(stream != null, "Unable to read empty web.xml"); try { try { return StreamUtils.copyToString(stream, Charset.forName("UTF-8")); } finally { stream.close(); } } catch (IOException ex) { throw new IllegalStateException(ex); } } } /** >>>>>>>
<<<<<<< AbstractTemplateViewResolver viewResolver = this.context .getBean(FreeMarkerViewResolver.class); assertThat(viewResolver).hasFieldOrPropertyWithValue("allowSessionOverride", true); ======= AbstractTemplateViewResolver viewResolver = this.context.getBean(FreeMarkerViewResolver.class); assertThat(ReflectionTestUtils.getField(viewResolver, "allowSessionOverride")).isEqualTo(true); >>>>>>> AbstractTemplateViewResolver viewResolver = this.context.getBean(FreeMarkerViewResolver.class); assertThat(viewResolver).hasFieldOrPropertyWithValue("allowSessionOverride", true); <<<<<<< load(FilterRegistrationOtherConfiguration.class, "spring.resources.chain.enabled:true"); Map<String, FilterRegistrationBean> beans = this.context .getBeansOfType(FilterRegistrationBean.class); ======= load(FilterRegistrationConfiguration.class, "spring.resources.chain.enabled:true"); Map<String, FilterRegistrationBean> beans = this.context.getBeansOfType(FilterRegistrationBean.class); >>>>>>> load(FilterRegistrationOtherConfiguration.class, "spring.resources.chain.enabled:true"); Map<String, FilterRegistrationBean> beans = this.context.getBeansOfType(FilterRegistrationBean.class); <<<<<<< public FilterRegistrationBean<OrderedCharacterEncodingFilter> filterRegistration() { return new FilterRegistrationBean<OrderedCharacterEncodingFilter>( new OrderedCharacterEncodingFilter()); ======= public FilterRegistrationBean<OrderedCharacterEncodingFilter> filterRegisration() { return new FilterRegistrationBean<OrderedCharacterEncodingFilter>(new OrderedCharacterEncodingFilter()); >>>>>>> public FilterRegistrationBean<OrderedCharacterEncodingFilter> filterRegistration() { return new FilterRegistrationBean<OrderedCharacterEncodingFilter>(new OrderedCharacterEncodingFilter());
<<<<<<< private static ClientRegistration getClientRegistration(String registrationId, OAuth2ClientProperties.Registration properties, Map<String, Provider> providers) { Builder builder = getBuilderFromIssuerIfPossible(registrationId, properties.getProvider(), providers); if (builder == null) { builder = getBuilder(registrationId, properties.getProvider(), providers); } ======= private static ClientRegistration getClientRegistration(String registrationId, Registration properties, Map<String, Provider> providers) { Builder builder = getBuilder(registrationId, properties.getProvider(), providers); >>>>>>> private static ClientRegistration getClientRegistration(String registrationId, OAuth2ClientProperties.Registration properties, Map<String, Provider> providers) { Builder builder = getBuilderFromIssuerIfPossible(registrationId, properties.getProvider(), providers); if (builder == null) { builder = getBuilder(registrationId, properties.getProvider(), providers); } <<<<<<< map.from(properties::getRedirectUri).to(builder::redirectUriTemplate); map.from(properties::getScope).as((scope) -> StringUtils.toStringArray(scope)) .to(builder::scope); ======= map.from(properties::getRedirectUriTemplate).to(builder::redirectUriTemplate); map.from(properties::getScope).as((scope) -> StringUtils.toStringArray(scope)).to(builder::scope); >>>>>>> map.from(properties::getRedirectUri).to(builder::redirectUriTemplate); map.from(properties::getScope).as((scope) -> StringUtils.toStringArray(scope)).to(builder::scope);
<<<<<<< import static org.assertj.core.api.Assertions.assertThat; ======= import org.springframework.util.StringUtils; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; >>>>>>> import org.springframework.util.StringUtils; import static org.assertj.core.api.Assertions.assertThat;
<<<<<<< assertThat(capturedOutput).doesNotContain("Initializing ExecutorService"); ======= assertThat(this.output.toString()).doesNotContain("Initializing ExecutorService"); >>>>>>> assertThat(capturedOutput).doesNotContain("Initializing ExecutorService"); <<<<<<< assertThat(context).getBean("applicationTaskExecutor") .isInstanceOf(ThreadPoolTaskExecutor.class); assertThat(capturedOutput).contains("Initializing ExecutorService"); ======= assertThat(context).getBean("applicationTaskExecutor").isInstanceOf(ThreadPoolTaskExecutor.class); assertThat(this.output.toString()).contains("Initializing ExecutorService"); >>>>>>> assertThat(context).getBean("applicationTaskExecutor").isInstanceOf(ThreadPoolTaskExecutor.class); assertThat(capturedOutput).contains("Initializing ExecutorService");
<<<<<<< import static org.mockito.ArgumentMatchers.any; ======= >>>>>>> <<<<<<< this.context = new SpringApplicationBuilder(ResourceConfiguration.class) .environment(this.environment).web(WebApplicationType.NONE).run(); assertThat(this.context.getBeansOfType(JwtAccessTokenConverter.class)).hasSize(1); } @Test public void jwtAccessTokenConverterRestTemplateCanBeCustomized() { EnvironmentTestUtils.addEnvironment(this.environment, "security.oauth2.resource.jwt.key-uri=http://localhost:12345/banana"); ======= >>>>>>> <<<<<<< .environment(this.environment).web(WebApplicationType.NONE).run(); JwtAccessTokenConverterRestTemplateCustomizer customizer = this.context .getBean(JwtAccessTokenConverterRestTemplateCustomizer.class); verify(customizer).customize(any(RestTemplate.class)); ======= .environment(this.environment).web(false).run(); assertThat(this.context.getBeansOfType(JwtAccessTokenConverter.class)).hasSize(1); >>>>>>> .environment(this.environment).web(WebApplicationType.NONE).run(); assertThat(this.context.getBeansOfType(JwtAccessTokenConverter.class)).hasSize(1);
<<<<<<< jsonText = ClientConnection.download(url); XContentParser parser = JsonXContent.jsonXContent.createParser(jsonText); Map<String, Object> map = parser == null ? null : parser.map(); ======= byte[] jsonText = ClientConnection.download(url); Map<String, Object> map = DAO.jsonMapper.readValue(jsonText, DAO.jsonTypeRef); >>>>>>> jsonText = ClientConnection.download(url); Map<String, Object> map = DAO.jsonMapper.readValue(jsonText, DAO.jsonTypeRef);
<<<<<<< public void systemPropertyWithXml() { this.contextRunner .withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY + "=classpath:org/springframework/boot/autoconfigure/hazelcast/" + "hazelcast-client-specific.xml") .run(assertSpecificHazelcastClient("explicit-xml")); ======= public void systemProperty() { this.contextRunner.withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY + "=classpath:org/springframework/boot/autoconfigure/hazelcast/" + "hazelcast-client-specific.xml") .run((context) -> assertThat(context).getBean(HazelcastInstance.class) .isInstanceOf(HazelcastInstance.class).has(nameStartingWith("hz.client_"))); >>>>>>> public void systemPropertyWithXml() { this.contextRunner.withSystemProperties(HazelcastClientConfiguration.CONFIG_SYSTEM_PROPERTY + "=classpath:org/springframework/boot/autoconfigure/hazelcast/" + "hazelcast-client-specific.xml") .run(assertSpecificHazelcastClient("explicit-xml")); <<<<<<< private ContextConsumer<AssertableApplicationContext> assertSpecificHazelcastClient( String label) { return (context) -> assertThat(context).getBean(HazelcastInstance.class) .isInstanceOf(HazelcastInstance.class).has(labelEqualTo(label)); } private static Condition<HazelcastInstance> labelEqualTo(String label) { return new Condition<>((o) -> ((HazelcastClientProxy) o).getClientConfig() .getLabels().stream().anyMatch((e) -> e.equals(label)), "Label equals to " + label); ======= private Condition<HazelcastInstance> nameStartingWith(String prefix) { return new Condition<>((o) -> o.getName().startsWith(prefix), "Name starts with " + prefix); >>>>>>> private ContextConsumer<AssertableApplicationContext> assertSpecificHazelcastClient(String label) { return (context) -> assertThat(context).getBean(HazelcastInstance.class).isInstanceOf(HazelcastInstance.class) .has(labelEqualTo(label)); } private static Condition<HazelcastInstance> labelEqualTo(String label) { return new Condition<>((o) -> ((HazelcastClientProxy) o).getClientConfig().getLabels().stream() .anyMatch((e) -> e.equals(label)), "Label equals to " + label);
<<<<<<< public void afterMaxUrisReachedFurtherUrisAreDenied(CapturedOutput capturedOutput) { this.contextRunner .withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class)) ======= public void afterMaxUrisReachedFurtherUrisAreDenied() { this.contextRunner.withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class)) >>>>>>> public void afterMaxUrisReachedFurtherUrisAreDenied(CapturedOutput capturedOutput) { this.contextRunner.withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class)) <<<<<<< assertThat(capturedOutput).doesNotContain( "Reached the maximum number of URI tags for 'http.server.requests'"); ======= assertThat(this.output.toString()) .doesNotContain("Reached the maximum number of URI tags for 'http.server.requests'"); >>>>>>> assertThat(capturedOutput) .doesNotContain("Reached the maximum number of URI tags for 'http.server.requests'"); <<<<<<< .withPropertyValues( "management.metrics.web.server.request.autotime.enabled=false") .run((context) -> { MeterRegistry registry = getInitializedMeterRegistry(context); assertThat(registry.find("http.server.requests").meter()).isNull(); }); } @Test @Deprecated public void metricsAreNotRecordedIfAutoTimeRequestsIsDisabledWithDeprecatedProperty() { this.contextRunner .withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class)) .withUserConfiguration(TestController.class) .withPropertyValues( "management.metrics.web.server.auto-time-requests=false") .run((context) -> { ======= .withPropertyValues("management.metrics.web.server.auto-time-requests=false").run((context) -> { >>>>>>> .withPropertyValues("management.metrics.web.server.request.autotime.enabled=false").run((context) -> { MeterRegistry registry = getInitializedMeterRegistry(context); assertThat(registry.find("http.server.requests").meter()).isNull(); }); } @Test @Deprecated public void metricsAreNotRecordedIfAutoTimeRequestsIsDisabledWithDeprecatedProperty() { this.contextRunner.withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class)) .withUserConfiguration(TestController.class) .withPropertyValues("management.metrics.web.server.auto-time-requests=false").run((context) -> {
<<<<<<< * @author Andrew McGhie ======= * @author Rafiullah Hamedy >>>>>>> * @author Andrew McGhie * @author Rafiullah Hamedy <<<<<<< void customMaxConnections() { ======= public void customDisableMaxHttpFormPostSize() { bind("server.tomcat.max-http-form-post-size=-1"); customizeAndRunServer((server) -> assertThat(server.getTomcat().getConnector().getMaxPostSize()).isEqualTo(-1)); } @Test public void customMaxConnections() { >>>>>>> void customDisableMaxHttpFormPostSize() { bind("server.tomcat.max-http-form-post-size=-1"); customizeAndRunServer((server) -> assertThat(server.getTomcat().getConnector().getMaxPostSize()).isEqualTo(-1)); } @Test void customMaxConnections() { <<<<<<< void customMaxHttpHeaderSize() { ======= public void customMaxHttpFormPostSize() { bind("server.tomcat.max-http-form-post-size=10000"); customizeAndRunServer( (server) -> assertThat(server.getTomcat().getConnector().getMaxPostSize()).isEqualTo(10000)); } @Test public void customMaxHttpHeaderSize() { >>>>>>> void customMaxHttpFormPostSize() { bind("server.tomcat.max-http-form-post-size=10000"); customizeAndRunServer( (server) -> assertThat(server.getTomcat().getConnector().getMaxPostSize()).isEqualTo(10000)); } @Test void customMaxHttpHeaderSize() {
<<<<<<< this.context = new AnnotationConfigApplicationContext( CustomTransactionManagerConfig.class, JtaAutoConfiguration.class); assertThatExceptionOfType(NoSuchBeanDefinitionException.class) .isThrownBy(() -> this.context.getBean(JtaTransactionManager.class)); ======= this.context = new AnnotationConfigApplicationContext(CustomTransactionManagerConfig.class, JtaAutoConfiguration.class); this.thrown.expect(NoSuchBeanDefinitionException.class); this.context.getBean(JtaTransactionManager.class); >>>>>>> this.context = new AnnotationConfigApplicationContext(CustomTransactionManagerConfig.class, JtaAutoConfiguration.class); assertThatExceptionOfType(NoSuchBeanDefinitionException.class) .isThrownBy(() -> this.context.getBean(JtaTransactionManager.class)); <<<<<<< ======= public void narayanaSanityCheck() { this.context = new AnnotationConfigApplicationContext(JtaProperties.class, NarayanaJtaConfiguration.class); this.context.getBean(NarayanaConfigurationBean.class); this.context.getBean(UserTransaction.class); this.context.getBean(TransactionManager.class); this.context.getBean(XADataSourceWrapper.class); this.context.getBean(XAConnectionFactoryWrapper.class); this.context.getBean(NarayanaBeanFactoryPostProcessor.class); this.context.getBean(JtaTransactionManager.class); this.context.getBean(RecoveryManagerService.class); } @Test >>>>>>> <<<<<<< this.context = new AnnotationConfigApplicationContext( BitronixJtaConfiguration.class); String serverId = this.context.getBean(bitronix.tm.Configuration.class) .getServerId(); ======= this.context = new AnnotationConfigApplicationContext(JtaPropertiesConfiguration.class, BitronixJtaConfiguration.class); String serverId = this.context.getBean(bitronix.tm.Configuration.class).getServerId(); >>>>>>> this.context = new AnnotationConfigApplicationContext(BitronixJtaConfiguration.class); String serverId = this.context.getBean(bitronix.tm.Configuration.class).getServerId(); <<<<<<< TestPropertyValues.of("spring.jta.transactionManagerId:custom") .applyTo(this.context); this.context.register(BitronixJtaConfiguration.class); ======= TestPropertyValues.of("spring.jta.transactionManagerId:custom").applyTo(this.context); this.context.register(JtaPropertiesConfiguration.class, BitronixJtaConfiguration.class); >>>>>>> TestPropertyValues.of("spring.jta.transactionManagerId:custom").applyTo(this.context); this.context.register(BitronixJtaConfiguration.class); <<<<<<< TestPropertyValues.of("spring.jta.logDir:target/transaction-logs") .applyTo(this.context); this.context.register(AtomikosJtaConfiguration.class); ======= TestPropertyValues.of("spring.jta.logDir:target/transaction-logs").applyTo(this.context); this.context.register(JtaPropertiesConfiguration.class, AtomikosJtaConfiguration.class); >>>>>>> TestPropertyValues.of("spring.jta.logDir:target/transaction-logs").applyTo(this.context); this.context.register(AtomikosJtaConfiguration.class); <<<<<<< TestPropertyValues .of("spring.jta.atomikos.connectionfactory.minPoolSize:5", "spring.jta.atomikos.connectionfactory.maxPoolSize:10") .applyTo(this.context); this.context.register(AtomikosJtaConfiguration.class, PoolConfiguration.class); ======= TestPropertyValues.of("spring.jta.atomikos.connectionfactory.minPoolSize:5", "spring.jta.atomikos.connectionfactory.maxPoolSize:10").applyTo(this.context); this.context.register(JtaPropertiesConfiguration.class, AtomikosJtaConfiguration.class, PoolConfiguration.class); >>>>>>> TestPropertyValues.of("spring.jta.atomikos.connectionfactory.minPoolSize:5", "spring.jta.atomikos.connectionfactory.maxPoolSize:10").applyTo(this.context); this.context.register(AtomikosJtaConfiguration.class, PoolConfiguration.class); <<<<<<< TestPropertyValues .of("spring.jta.bitronix.connectionfactory.minPoolSize:5", "spring.jta.bitronix.connectionfactory.maxPoolSize:10") .applyTo(this.context); this.context.register(BitronixJtaConfiguration.class, PoolConfiguration.class); ======= TestPropertyValues.of("spring.jta.bitronix.connectionfactory.minPoolSize:5", "spring.jta.bitronix.connectionfactory.maxPoolSize:10").applyTo(this.context); this.context.register(JtaPropertiesConfiguration.class, BitronixJtaConfiguration.class, PoolConfiguration.class); >>>>>>> TestPropertyValues.of("spring.jta.bitronix.connectionfactory.minPoolSize:5", "spring.jta.bitronix.connectionfactory.maxPoolSize:10").applyTo(this.context); this.context.register(BitronixJtaConfiguration.class, PoolConfiguration.class); <<<<<<< this.context.register(AtomikosJtaConfiguration.class, PoolConfiguration.class); ======= this.context.register(JtaPropertiesConfiguration.class, AtomikosJtaConfiguration.class, PoolConfiguration.class); >>>>>>> this.context.register(AtomikosJtaConfiguration.class, PoolConfiguration.class); <<<<<<< this.context.register(BitronixJtaConfiguration.class, PoolConfiguration.class); ======= this.context.register(JtaPropertiesConfiguration.class, BitronixJtaConfiguration.class, PoolConfiguration.class); >>>>>>> this.context.register(BitronixJtaConfiguration.class, PoolConfiguration.class); <<<<<<< ======= @Test public void narayanaRecoveryManagerBeanCanBeCustomized() { this.context = new AnnotationConfigApplicationContext(); this.context.register(CustomNarayanaRecoveryManagerConfiguration.class, JtaProperties.class, NarayanaJtaConfiguration.class); this.context.refresh(); assertThat(this.context.getBean(NarayanaRecoveryManagerBean.class)) .isInstanceOf(CustomNarayanaRecoveryManagerBean.class); } @Configuration @EnableConfigurationProperties(JtaProperties.class) public static class JtaPropertiesConfiguration { } >>>>>>> <<<<<<< ======= @Configuration public static class CustomNarayanaRecoveryManagerConfiguration { @Bean public NarayanaRecoveryManagerBean customRecoveryManagerBean(RecoveryManagerService recoveryManagerService) { return new CustomNarayanaRecoveryManagerBean(recoveryManagerService); } } static final class CustomNarayanaRecoveryManagerBean extends NarayanaRecoveryManagerBean { private CustomNarayanaRecoveryManagerBean(RecoveryManagerService recoveryManagerService) { super(recoveryManagerService); } } >>>>>>>
<<<<<<< TestPropertyValues.of("logging.file.name:" + this.logFile.getAbsolutePath()) .applyTo(context); client.get().uri("/actuator/logfile").exchange().expectStatus().isOk() .expectHeader().contentType("text/plain; charset=UTF-8") .expectBody(String.class).isEqualTo("--TEST--"); ======= TestPropertyValues.of("logging.file:" + this.logFile.getAbsolutePath()).applyTo(context); client.get().uri("/actuator/logfile").exchange().expectStatus().isOk().expectHeader() .contentType("text/plain; charset=UTF-8").expectBody(String.class).isEqualTo("--TEST--"); >>>>>>> TestPropertyValues.of("logging.file.name:" + this.logFile.getAbsolutePath()).applyTo(context); client.get().uri("/actuator/logfile").exchange().expectStatus().isOk().expectHeader() .contentType("text/plain; charset=UTF-8").expectBody(String.class).isEqualTo("--TEST--");
<<<<<<< @SpringBootTest( properties = "spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}") @EmbeddedKafka(topics = "testTopic") class SampleKafkaApplicationTests { ======= @RunWith(SpringRunner.class) @SpringBootTest(properties = "spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}") @EmbeddedKafka public class SampleKafkaApplicationTests { >>>>>>> @SpringBootTest(properties = "spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}") @EmbeddedKafka(topics = "testTopic") class SampleKafkaApplicationTests { <<<<<<< while (this.consumer.getMessages().isEmpty() && System.currentTimeMillis() < end) { ======= while (!this.outputCapture.toString().contains("A simple test message") && System.currentTimeMillis() < end) { >>>>>>> while (this.consumer.getMessages().isEmpty() && System.currentTimeMillis() < end) {
<<<<<<< public void setInitializers( Collection<? extends ApplicationContextInitializer<?>> initializers) { this.initializers = new ArrayList<>(initializers); ======= public void setInitializers(Collection<? extends ApplicationContextInitializer<?>> initializers) { this.initializers = new ArrayList<>(); this.initializers.addAll(initializers); >>>>>>> public void setInitializers(Collection<? extends ApplicationContextInitializer<?>> initializers) { this.initializers = new ArrayList<>(initializers);
<<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isStrictlyEqualToJson("lenient-same.json", getClass())); ======= assertThat(forJson(SOURCE)).isStrictlyEqualToJson("lenient-same.json", getClass()); >>>>>>> assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isStrictlyEqualToJson("lenient-same.json", getClass())); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isStrictlyEqualToJson(createInputStream(LENIENT_SAME))); ======= assertThat(forJson(SOURCE)).isStrictlyEqualToJson(createInputStream(LENIENT_SAME)); >>>>>>> assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isStrictlyEqualToJson(createInputStream(LENIENT_SAME))); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isEqualToJson("different.json", JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isEqualToJson("different.json", JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isEqualToJson("different.json", JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isEqualToJson("different.json", getClass(), JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isEqualToJson("different.json", getClass(), JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isEqualToJson("different.json", getClass(), JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isEqualToJson(DIFFERENT.getBytes(), JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isEqualToJson(DIFFERENT.getBytes(), JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isEqualToJson(DIFFERENT.getBytes(), JSONCompareMode.LENIENT)); <<<<<<< @Test public void isEqualToJsonWhenFileIsNotMatchingAndLenientShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isEqualToJson(createFile(DIFFERENT), JSONCompareMode.LENIENT)); ======= @Test(expected = AssertionError.class) public void isEqualToJsonWhenFileIsNotMatchingAndLenientShouldFail() throws Exception { assertThat(forJson(SOURCE)).isEqualToJson(createFile(DIFFERENT), JSONCompareMode.LENIENT); >>>>>>> @Test public void isEqualToJsonWhenFileIsNotMatchingAndLenientShouldFail() { assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isEqualToJson(createFile(DIFFERENT), JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isEqualToJson( createInputStream(DIFFERENT), JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isEqualToJson(createInputStream(DIFFERENT), JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isEqualToJson(createInputStream(DIFFERENT), JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isEqualToJson(createResource(DIFFERENT), JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isEqualToJson(createResource(DIFFERENT), JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isEqualToJson(createResource(DIFFERENT), JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isEqualToJson("different.json", getClass(), COMPARATOR)); ======= assertThat(forJson(SOURCE)).isEqualToJson("different.json", getClass(), COMPARATOR); >>>>>>> assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isEqualToJson("different.json", getClass(), COMPARATOR)); <<<<<<< @Test public void isEqualToJsonWhenFileIsNotMatchingAndComparatorShouldFail() throws Exception { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isEqualToJson(createFile(DIFFERENT), COMPARATOR)); ======= @Test(expected = AssertionError.class) public void isEqualToJsonWhenFileIsNotMatchingAndComparatorShouldFail() throws Exception { assertThat(forJson(SOURCE)).isEqualToJson(createFile(DIFFERENT), COMPARATOR); >>>>>>> @Test public void isEqualToJsonWhenFileIsNotMatchingAndComparatorShouldFail() throws Exception { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isEqualToJson(createFile(DIFFERENT), COMPARATOR)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isEqualToJson(createInputStream(DIFFERENT), COMPARATOR)); ======= assertThat(forJson(SOURCE)).isEqualToJson(createInputStream(DIFFERENT), COMPARATOR); >>>>>>> assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isEqualToJson(createInputStream(DIFFERENT), COMPARATOR)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson(LENIENT_SAME, JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson(LENIENT_SAME, JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualToJson(LENIENT_SAME, JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson("lenient-same.json", JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson("lenient-same.json", JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isNotEqualToJson("lenient-same.json", JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isNotEqualToJson("lenient-same.json", getClass(), JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson("lenient-same.json", getClass(), JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson("lenient-same.json", getClass(), JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualToJson( LENIENT_SAME.getBytes(), JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson(LENIENT_SAME.getBytes(), JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isNotEqualToJson(LENIENT_SAME.getBytes(), JSONCompareMode.LENIENT)); <<<<<<< @Test public void isNotEqualToJsonWhenFileIsMatchingAndLenientShouldFail() throws Exception { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualToJson( createFile(LENIENT_SAME), JSONCompareMode.LENIENT)); ======= @Test(expected = AssertionError.class) public void isNotEqualToJsonWhenFileIsMatchingAndLenientShouldFail() throws Exception { assertThat(forJson(SOURCE)).isNotEqualToJson(createFile(LENIENT_SAME), JSONCompareMode.LENIENT); >>>>>>> @Test public void isNotEqualToJsonWhenFileIsMatchingAndLenientShouldFail() throws Exception { assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isNotEqualToJson(createFile(LENIENT_SAME), JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualToJson( createInputStream(LENIENT_SAME), JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson(createInputStream(LENIENT_SAME), JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson(createInputStream(LENIENT_SAME), JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualToJson( createResource(LENIENT_SAME), JSONCompareMode.LENIENT)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson(createResource(LENIENT_SAME), JSONCompareMode.LENIENT); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson(createResource(LENIENT_SAME), JSONCompareMode.LENIENT)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson("lenient-same.json", getClass(), COMPARATOR)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson("lenient-same.json", getClass(), COMPARATOR); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isNotEqualToJson("lenient-same.json", getClass(), COMPARATOR)); <<<<<<< @Test public void isNotEqualToJsonWhenFileIsMatchingAndComparatorShouldFail() throws Exception { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson(createFile(LENIENT_SAME), COMPARATOR)); ======= @Test(expected = AssertionError.class) public void isNotEqualToJsonWhenFileIsMatchingAndComparatorShouldFail() throws Exception { assertThat(forJson(SOURCE)).isNotEqualToJson(createFile(LENIENT_SAME), COMPARATOR); >>>>>>> @Test public void isNotEqualToJsonWhenFileIsMatchingAndComparatorShouldFail() throws Exception { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualToJson(createFile(LENIENT_SAME), COMPARATOR)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson(createInputStream(LENIENT_SAME), COMPARATOR)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson(createInputStream(LENIENT_SAME), COMPARATOR); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isNotEqualToJson(createInputStream(LENIENT_SAME), COMPARATOR)); <<<<<<< assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)) .isNotEqualToJson(createResource(LENIENT_SAME), COMPARATOR)); ======= assertThat(forJson(SOURCE)).isNotEqualToJson(createResource(LENIENT_SAME), COMPARATOR); >>>>>>> assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isNotEqualToJson(createResource(LENIENT_SAME), COMPARATOR));
<<<<<<< void getVehicleDetailsWhenVinIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.service.getVehicleDetails(null)) ======= public void getVehicleDetailsWhenVinIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.service.getVehicleDetails(null)) >>>>>>> void getVehicleDetailsWhenVinIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.service.getVehicleDetails(null)) <<<<<<< void getVehicleDetailsWhenResultIsNotFoundShouldThrowException() { this.server.expect(requestTo("/vehicle/" + VIN + "/details")) .andRespond(withStatus(HttpStatus.NOT_FOUND)); ======= public void getVehicleDetailsWhenResultIsNotFoundShouldThrowException() { this.server.expect(requestTo("/vehicle/" + VIN + "/details")).andRespond(withStatus(HttpStatus.NOT_FOUND)); >>>>>>> void getVehicleDetailsWhenResultIsNotFoundShouldThrowException() { this.server.expect(requestTo("/vehicle/" + VIN + "/details")).andRespond(withStatus(HttpStatus.NOT_FOUND)); <<<<<<< void getVehicleDetailsWhenResultIServerErrorShouldThrowException() { this.server.expect(requestTo("/vehicle/" + VIN + "/details")) .andRespond(withServerError()); ======= public void getVehicleDetailsWhenResultIServerErrorShouldThrowException() { this.server.expect(requestTo("/vehicle/" + VIN + "/details")).andRespond(withServerError()); >>>>>>> void getVehicleDetailsWhenResultIServerErrorShouldThrowException() { this.server.expect(requestTo("/vehicle/" + VIN + "/details")).andRespond(withServerError());
<<<<<<< void connectionToRootUsingAbsoluteUrl() throws Exception { URL url = new URL("jar:file:" + getAbsolutePath() + "!/"); ======= public void connectionToRootUsingAbsoluteUrl() throws Exception { URL url = new URL("jar:" + this.rootJarFile.toURI().toURL() + "!/"); >>>>>>> void connectionToRootUsingAbsoluteUrl() throws Exception { URL url = new URL("jar:" + this.rootJarFile.toURI().toURL() + "!/"); <<<<<<< void connectionToEntryUsingAbsoluteUrl() throws Exception { URL url = new URL("jar:file:" + getAbsolutePath() + "!/1.dat"); try (InputStream input = JarURLConnection.get(url, this.jarFile).getInputStream()) { assertThat(input).hasSameContentAs(new ByteArrayInputStream(new byte[] { 1 })); } ======= public void connectionToEntryUsingAbsoluteUrl() throws Exception { URL url = new URL("jar:" + this.rootJarFile.toURI().toURL() + "!/1.dat"); assertThat(JarURLConnection.get(url, this.jarFile).getInputStream()) .hasSameContentAs(new ByteArrayInputStream(new byte[] { 1 })); >>>>>>> void connectionToEntryUsingAbsoluteUrl() throws Exception { URL url = new URL("jar:" + this.rootJarFile.toURI().toURL() + "!/1.dat"); try (InputStream input = JarURLConnection.get(url, this.jarFile).getInputStream()) { assertThat(input).hasSameContentAs(new ByteArrayInputStream(new byte[] { 1 })); } <<<<<<< void connectionToEntryUsingAbsoluteUrlForEntryFromNestedJarFile() throws Exception { URL url = new URL("jar:file:" + getAbsolutePath() + "!/nested.jar!/3.dat"); try (JarFile nested = this.jarFile.getNestedJarFile(this.jarFile.getEntry("nested.jar"))) { try (InputStream input = JarURLConnection.get(url, nested).getInputStream()) { assertThat(input).hasSameContentAs(new ByteArrayInputStream(new byte[] { 3 })); } } ======= public void connectionToEntryUsingAbsoluteUrlForEntryFromNestedJarFile() throws Exception { URL url = new URL("jar:" + this.rootJarFile.toURI().toURL() + "!/nested.jar!/3.dat"); JarFile nested = this.jarFile.getNestedJarFile(this.jarFile.getEntry("nested.jar")); assertThat(JarURLConnection.get(url, nested).getInputStream()) .hasSameContentAs(new ByteArrayInputStream(new byte[] { 3 })); >>>>>>> void connectionToEntryUsingAbsoluteUrlForEntryFromNestedJarFile() throws Exception { URL url = new URL("jar:" + this.rootJarFile.toURI().toURL() + "!/nested.jar!/3.dat"); try (JarFile nested = this.jarFile.getNestedJarFile(this.jarFile.getEntry("nested.jar"))) { try (InputStream input = JarURLConnection.get(url, nested).getInputStream()) { assertThat(input).hasSameContentAs(new ByteArrayInputStream(new byte[] { 3 })); } } <<<<<<< void connectionToEntryInNestedJarFromUrlThatUsesExistingUrlAsContext() throws Exception { URL url = new URL(new URL("jar", null, -1, "file:" + getAbsolutePath() + "!/nested.jar!/", new Handler()), ======= public void connectionToEntryInNestedJarFromUrlThatUsesExistingUrlAsContext() throws Exception { URL url = new URL(new URL("jar", null, -1, this.rootJarFile.toURI().toURL() + "!/nested.jar!/", new Handler()), >>>>>>> void connectionToEntryInNestedJarFromUrlThatUsesExistingUrlAsContext() throws Exception { URL url = new URL(new URL("jar", null, -1, this.rootJarFile.toURI().toURL() + "!/nested.jar!/", new Handler()),
<<<<<<< * @author Raheela Aslam ======= * @since 2.0.0 >>>>>>> * @author Raheela Aslam * @since 2.0.0
<<<<<<< @Configuration(proxyBeanMethods = false) @ComponentScan(excludeFilters = @ComponentScan.Filter(classes = { Session.class }, type = FilterType.ASSIGNABLE_TYPE)) ======= @Configuration @ComponentScan( excludeFilters = @ComponentScan.Filter(classes = { Session.class }, type = FilterType.ASSIGNABLE_TYPE)) >>>>>>> @Configuration(proxyBeanMethods = false) @ComponentScan( excludeFilters = @ComponentScan.Filter(classes = { Session.class }, type = FilterType.ASSIGNABLE_TYPE))
<<<<<<< verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/javax.servlet-api-4"); assertThat(verifier .hasEntry("org/springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isTrue(); assertThat(verifier .hasEntry("BOOT-INF/classes/org/test/SampleApplication.class")) .as("Own classes").isTrue(); ======= verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/javax.servlet-api-3"); assertThat(verifier.hasEntry("org/springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isTrue(); assertThat(verifier.hasEntry("BOOT-INF/classes/org/test/SampleApplication.class")).as("Own classes") .isTrue(); >>>>>>> verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/javax.servlet-api-4"); assertThat(verifier.hasEntry("org/springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isTrue(); assertThat(verifier.hasEntry("BOOT-INF/classes/org/test/SampleApplication.class")).as("Own classes") .isTrue(); <<<<<<< verifier.assertHasEntryNameStartingWith( "WEB-INF/lib-provided/javax.servlet-api-4"); assertThat(verifier .hasEntry("org/" + "springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isTrue(); assertThat(verifier .hasEntry("WEB-INF/classes/org/" + "test/SampleApplication.class")) .as("Own classes").isTrue(); ======= verifier.assertHasEntryNameStartingWith("WEB-INF/lib-provided/javax.servlet-api-3"); assertThat(verifier.hasEntry("org/" + "springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isTrue(); assertThat(verifier.hasEntry("WEB-INF/classes/org/" + "test/SampleApplication.class")).as("Own classes") .isTrue(); >>>>>>> verifier.assertHasEntryNameStartingWith("WEB-INF/lib-provided/javax.servlet-api-4"); assertThat(verifier.hasEntry("org/" + "springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isTrue(); assertThat(verifier.hasEntry("WEB-INF/classes/org/" + "test/SampleApplication.class")).as("Own classes") .isTrue(); <<<<<<< verifier.assertHasNoEntryNameStartingWith("lib/javax.servlet-api"); assertThat(verifier .hasEntry("org/" + "springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isFalse(); assertThat(verifier.hasEntry("org/" + "test/SampleModule.class")) .as("Own classes").isTrue(); ======= verifier.assertHasNoEntryNameStartingWith("lib/javax.servlet-api-3"); assertThat(verifier.hasEntry("org/" + "springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isFalse(); assertThat(verifier.hasEntry("org/" + "test/SampleModule.class")).as("Own classes").isTrue(); >>>>>>> verifier.assertHasNoEntryNameStartingWith("lib/javax.servlet-api"); assertThat(verifier.hasEntry("org/" + "springframework/boot/loader/JarLauncher.class")) .as("Unpacked launcher classes").isFalse(); assertThat(verifier.hasEntry("org/" + "test/SampleModule.class")).as("Own classes").isTrue();
<<<<<<< ======= import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; >>>>>>>
<<<<<<< public class AnnotationConfigReactiveWebApplicationContext extends AnnotationConfigApplicationContext implements ConfigurableReactiveWebApplicationContext { ======= public class AnnotationConfigReactiveWebApplicationContext extends AbstractRefreshableConfigApplicationContext implements ConfigurableReactiveWebApplicationContext, AnnotationConfigRegistry { >>>>>>> public class AnnotationConfigReactiveWebApplicationContext extends AnnotationConfigApplicationContext implements ConfigurableReactiveWebApplicationContext { <<<<<<< throw new UnsupportedOperationException(); ======= return this.scopeMetadataResolver; } /** * Register one or more annotated classes to be processed. * <p> * Note that {@link #refresh()} must be called in order for the context to fully * process the new classes. * @param annotatedClasses one or more annotated classes, e.g. * {@link org.springframework.context.annotation.Configuration @Configuration} classes * @see #scan(String...) * @see #loadBeanDefinitions(DefaultListableBeanFactory) * @see #setConfigLocation(String) * @see #refresh() */ @Override public void register(Class<?>... annotatedClasses) { Assert.notEmpty(annotatedClasses, "At least one annotated class must be specified"); this.annotatedClasses.addAll(Arrays.asList(annotatedClasses)); } /** * Perform a scan within the specified base packages. * <p> * Note that {@link #refresh()} must be called in order for the context to fully * process the new classes. * @param basePackages the packages to check for annotated classes * @see #loadBeanDefinitions(DefaultListableBeanFactory) * @see #register(Class...) * @see #setConfigLocation(String) * @see #refresh() */ @Override public void scan(String... basePackages) { Assert.notEmpty(basePackages, "At least one base package must be specified"); this.basePackages.addAll(Arrays.asList(basePackages)); >>>>>>> throw new UnsupportedOperationException(); <<<<<<< throw new UnsupportedOperationException(); ======= AnnotatedBeanDefinitionReader reader = getAnnotatedBeanDefinitionReader(beanFactory); ClassPathBeanDefinitionScanner scanner = getClassPathBeanDefinitionScanner(beanFactory); applyBeanNameGenerator(beanFactory, reader, scanner); applyScopeMetadataResolver(reader, scanner); loadBeanDefinitions(reader, scanner); } private void applyBeanNameGenerator(DefaultListableBeanFactory beanFactory, AnnotatedBeanDefinitionReader reader, ClassPathBeanDefinitionScanner scanner) { BeanNameGenerator beanNameGenerator = getBeanNameGenerator(); if (beanNameGenerator != null) { reader.setBeanNameGenerator(beanNameGenerator); scanner.setBeanNameGenerator(beanNameGenerator); beanFactory.registerSingleton(AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR, beanNameGenerator); } } private void applyScopeMetadataResolver(AnnotatedBeanDefinitionReader reader, ClassPathBeanDefinitionScanner scanner) { ScopeMetadataResolver scopeMetadataResolver = getScopeMetadataResolver(); if (scopeMetadataResolver != null) { reader.setScopeMetadataResolver(scopeMetadataResolver); scanner.setScopeMetadataResolver(scopeMetadataResolver); } } private void loadBeanDefinitions(AnnotatedBeanDefinitionReader reader, ClassPathBeanDefinitionScanner scanner) throws LinkageError { if (!this.annotatedClasses.isEmpty()) { registerAnnotatedClasses(reader); } if (!this.basePackages.isEmpty()) { scanBasePackages(scanner); } String[] configLocations = getConfigLocations(); if (configLocations != null) { registerConfigLocations(reader, scanner, configLocations); } } private void registerAnnotatedClasses(AnnotatedBeanDefinitionReader reader) { if (this.logger.isInfoEnabled()) { this.logger.info("Registering annotated classes: [" + StringUtils.collectionToCommaDelimitedString(this.annotatedClasses) + "]"); } reader.register(ClassUtils.toClassArray(this.annotatedClasses)); } private void scanBasePackages(ClassPathBeanDefinitionScanner scanner) { if (this.logger.isInfoEnabled()) { this.logger.info("Scanning base packages: [" + StringUtils.collectionToCommaDelimitedString(this.basePackages) + "]"); } scanner.scan(StringUtils.toStringArray(this.basePackages)); } private void registerConfigLocations(AnnotatedBeanDefinitionReader reader, ClassPathBeanDefinitionScanner scanner, String[] configLocations) throws LinkageError { for (String configLocation : configLocations) { try { register(reader, configLocation); } catch (ClassNotFoundException ex) { if (this.logger.isDebugEnabled()) { this.logger.debug("Could not load class for config location [" + configLocation + "] - trying package scan. " + ex); } int count = scanner.scan(configLocation); if (this.logger.isInfoEnabled()) { logScanResult(configLocation, count); } } } } private void register(AnnotatedBeanDefinitionReader reader, String configLocation) throws ClassNotFoundException, LinkageError { Class<?> clazz = ClassUtils.forName(configLocation, getClassLoader()); if (this.logger.isInfoEnabled()) { this.logger.info("Successfully resolved class for [" + configLocation + "]"); } reader.register(clazz); } private void logScanResult(String configLocation, int count) { if (count == 0) { this.logger.info("No annotated classes found for specified class/package [" + configLocation + "]"); } else { this.logger.info("Found " + count + " annotated classes in package [" + configLocation + "]"); } >>>>>>> throw new UnsupportedOperationException(); <<<<<<< @Deprecated protected AnnotatedBeanDefinitionReader getAnnotatedBeanDefinitionReader( DefaultListableBeanFactory beanFactory) { throw new UnsupportedOperationException(); ======= protected AnnotatedBeanDefinitionReader getAnnotatedBeanDefinitionReader(DefaultListableBeanFactory beanFactory) { return new AnnotatedBeanDefinitionReader(beanFactory, getEnvironment()); >>>>>>> @Deprecated protected AnnotatedBeanDefinitionReader getAnnotatedBeanDefinitionReader(DefaultListableBeanFactory beanFactory) { throw new UnsupportedOperationException(); <<<<<<< @Deprecated protected ClassPathBeanDefinitionScanner getClassPathBeanDefinitionScanner( DefaultListableBeanFactory beanFactory) { throw new UnsupportedOperationException(); ======= protected ClassPathBeanDefinitionScanner getClassPathBeanDefinitionScanner(DefaultListableBeanFactory beanFactory) { return new ClassPathBeanDefinitionScanner(beanFactory, true, getEnvironment()); >>>>>>> @Deprecated protected ClassPathBeanDefinitionScanner getClassPathBeanDefinitionScanner(DefaultListableBeanFactory beanFactory) { throw new UnsupportedOperationException();
<<<<<<< appendCharset(this.properties.getServlet().getContentType(), resolver.getCharacterEncoding())); resolver.setProducePartialOutputWhileProcessing(this.properties .getServlet().isProducePartialOutputWhileProcessing()); ======= appendCharset(this.properties.getServlet().getContentType(), resolver.getCharacterEncoding())); >>>>>>> appendCharset(this.properties.getServlet().getContentType(), resolver.getCharacterEncoding())); resolver.setProducePartialOutputWhileProcessing( this.properties.getServlet().isProducePartialOutputWhileProcessing()); <<<<<<< ThymeleafReactiveConfiguration(ThymeleafProperties properties, Collection<ITemplateResolver> templateResolvers, ObjectProvider<IDialect> dialectsProvider) { ======= ThymeleafReactiveConfiguration(ThymeleafProperties properties, Collection<ITemplateResolver> templateResolvers, ObjectProvider<Collection<IDialect>> dialectsProvider) { >>>>>>> ThymeleafReactiveConfiguration(ThymeleafProperties properties, Collection<ITemplateResolver> templateResolvers, ObjectProvider<IDialect> dialectsProvider) { <<<<<<< map.from(properties::getMediaTypes).whenNonNull() .to(resolver::setSupportedMediaTypes); map.from(properties::getMaxChunkSize).asInt(DataSize::toBytes) .when((size) -> size > 0).to(resolver::setResponseMaxChunkSizeBytes); ======= map.from(properties::getMediaTypes).whenNonNull().to(resolver::setSupportedMediaTypes); map.from(properties::getMaxChunkSize).when((size) -> size > 0).to(resolver::setResponseMaxChunkSizeBytes); >>>>>>> map.from(properties::getMediaTypes).whenNonNull().to(resolver::setSupportedMediaTypes); map.from(properties::getMaxChunkSize).asInt(DataSize::toBytes).when((size) -> size > 0) .to(resolver::setResponseMaxChunkSizeBytes); <<<<<<< ======= private final Log logger = LogFactory.getLog(ThymeleafSecurityDialectConfiguration.class); >>>>>>> <<<<<<< ======= @ConditionalOnClass({ org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect.class }) protected static class ThymeleafSecurity5DialectConfiguration { @Bean @ConditionalOnMissingBean public org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect securityDialect() { return new org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect(); } } @Configuration >>>>>>>
<<<<<<< void testCreate() throws Exception { this.mockMvc.perform(post("/").param("text", "FOO text").param("summary", "FOO")) .andExpect(status().isFound()) ======= public void testCreate() throws Exception { this.mockMvc.perform(post("/").param("text", "FOO text").param("summary", "FOO")).andExpect(status().isFound()) >>>>>>> void testCreate() throws Exception { this.mockMvc.perform(post("/").param("text", "FOO text").param("summary", "FOO")).andExpect(status().isFound()) <<<<<<< void testCreateValidation() throws Exception { this.mockMvc.perform(post("/").param("text", "").param("summary", "")) .andExpect(status().isOk()) ======= public void testCreateValidation() throws Exception { this.mockMvc.perform(post("/").param("text", "").param("summary", "")).andExpect(status().isOk()) >>>>>>> void testCreateValidation() throws Exception { this.mockMvc.perform(post("/").param("text", "").param("summary", "")).andExpect(status().isOk())
<<<<<<< void startupFailureDoesNotResultInUnstoppedThreadsBeingReported(CapturedOutput output) throws IOException { ======= public void primaryConnectorPortClashThrowsWebServerException() throws Exception { doWithBlockedPort((port) -> { TomcatServletWebServerFactory factory = getFactory(); factory.setPort(port); assertThatExceptionOfType(WebServerException.class).isThrownBy(() -> { this.webServer = factory.getWebServer(); this.webServer.start(); }); }); } @Test public void startupFailureDoesNotResultInUnstoppedThreadsBeingReported() throws Exception { >>>>>>> void startupFailureDoesNotResultInUnstoppedThreadsBeingReported(CapturedOutput output) throws Exception {
<<<<<<< ======= private final PlatformTransactionManager transactionManager; public TransactionTemplateConfiguration(PlatformTransactionManager transactionManager) { this.transactionManager = transactionManager; } >>>>>>>
<<<<<<< AnnotationConfigServletWebServerApplicationContext::new).withConfiguration( AutoConfigurations.of(ServletWebServerFactoryAutoConfiguration.class, DispatcherServletAutoConfiguration.class, JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class, EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class, ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class, HttpTraceAutoConfiguration.class, HealthIndicatorAutoConfiguration.class)) .withConfiguration( AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL)) .withUserConfiguration(CustomMvcEndpoint.class, CustomServletEndpoint.class) ======= AnnotationConfigServletWebServerApplicationContext::new) .withConfiguration(AutoConfigurations.of(ServletWebServerFactoryAutoConfiguration.class, DispatcherServletAutoConfiguration.class, JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class, EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class, ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class, HttpTraceAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL)) .withUserConfiguration(CustomMvcEndpoint.class, CustomServletEndpoint.class) >>>>>>> AnnotationConfigServletWebServerApplicationContext::new) .withConfiguration(AutoConfigurations.of(ServletWebServerFactoryAutoConfiguration.class, DispatcherServletAutoConfiguration.class, JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class, EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class, ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class, HttpTraceAutoConfiguration.class, HealthIndicatorAutoConfiguration.class)) .withConfiguration(AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL)) .withUserConfiguration(CustomMvcEndpoint.class, CustomServletEndpoint.class)
<<<<<<< ObjectProvider<HibernatePropertiesCustomizer> hibernatePropertiesCustomizers) { super(dataSource, jpaProperties, jtaTransactionManager, transactionManagerCustomizers); this.hibernateProperties = hibernateProperties; this.defaultDdlAutoProvider = new HibernateDefaultDdlAutoProvider(providers); this.poolMetadataProvider = new CompositeDataSourcePoolMetadataProvider( metadataProviders.getIfAvailable()); ======= ObjectProvider<List<HibernatePropertiesCustomizer>> hibernatePropertiesCustomizers) { super(dataSource, jpaProperties, jtaTransactionManager, transactionManagerCustomizers); this.defaultDdlAutoProvider = new HibernateDefaultDdlAutoProvider( providers.getIfAvailable(Collections::emptyList)); this.poolMetadataProvider = new CompositeDataSourcePoolMetadataProvider(metadataProviders.getIfAvailable()); >>>>>>> ObjectProvider<HibernatePropertiesCustomizer> hibernatePropertiesCustomizers) { super(dataSource, jpaProperties, jtaTransactionManager, transactionManagerCustomizers); this.hibernateProperties = hibernateProperties; this.defaultDdlAutoProvider = new HibernateDefaultDdlAutoProvider(providers); this.poolMetadataProvider = new CompositeDataSourcePoolMetadataProvider(metadataProviders.getIfAvailable()); <<<<<<< physicalNamingStrategy.getIfAvailable(), implicitNamingStrategy.getIfAvailable(), beanFactory, hibernatePropertiesCustomizers.orderedStream() .collect(Collectors.toList())); ======= physicalNamingStrategy.getIfAvailable(), implicitNamingStrategy.getIfAvailable(), hibernatePropertiesCustomizers.getIfAvailable(Collections::emptyList)); >>>>>>> physicalNamingStrategy.getIfAvailable(), implicitNamingStrategy.getIfAvailable(), beanFactory, hibernatePropertiesCustomizers.orderedStream().collect(Collectors.toList())); <<<<<<< PhysicalNamingStrategy physicalNamingStrategy, ImplicitNamingStrategy implicitNamingStrategy, ConfigurableListableBeanFactory beanFactory, ======= PhysicalNamingStrategy physicalNamingStrategy, ImplicitNamingStrategy implicitNamingStrategy, >>>>>>> PhysicalNamingStrategy physicalNamingStrategy, ImplicitNamingStrategy implicitNamingStrategy, ConfigurableListableBeanFactory beanFactory, <<<<<<< customizers.add(new NamingStrategiesHibernatePropertiesCustomizer( physicalNamingStrategy, implicitNamingStrategy)); ======= LinkedList<HibernatePropertiesCustomizer> customizers = new LinkedList<>(hibernatePropertiesCustomizers); customizers.addFirst( new NamingStrategiesHibernatePropertiesCustomizer(physicalNamingStrategy, implicitNamingStrategy)); return customizers; >>>>>>> customizers.add( new NamingStrategiesHibernatePropertiesCustomizer(physicalNamingStrategy, implicitNamingStrategy)); <<<<<<< Supplier<String> defaultDdlMode = () -> this.defaultDdlAutoProvider .getDefaultDdlAuto(getDataSource()); return new LinkedHashMap<>(this.hibernateProperties.determineHibernateProperties( getProperties().getProperties(), new HibernateSettings().ddlAuto(defaultDdlMode) .hibernatePropertiesCustomizers( this.hibernatePropertiesCustomizers))); ======= Supplier<String> defaultDdlMode = () -> this.defaultDdlAutoProvider.getDefaultDdlAuto(getDataSource()); return new LinkedHashMap<>(getProperties().getHibernateProperties(new HibernateSettings() .ddlAuto(defaultDdlMode).hibernatePropertiesCustomizers(this.hibernatePropertiesCustomizers))); >>>>>>> Supplier<String> defaultDdlMode = () -> this.defaultDdlAutoProvider.getDefaultDdlAuto(getDataSource()); return new LinkedHashMap<>(this.hibernateProperties .determineHibernateProperties(getProperties().getProperties(), new HibernateSettings() .ddlAuto(defaultDdlMode).hibernatePropertiesCustomizers(this.hibernatePropertiesCustomizers))); <<<<<<< ======= private void configureWebSphereTransactionPlatform(Map<String, Object> vendorProperties) { vendorProperties.put(JTA_PLATFORM, getWebSphereJtaPlatformManager()); } private Object getWebSphereJtaPlatformManager() { return getJtaPlatformManager(WEBSPHERE_JTA_PLATFORM_CLASSES); } >>>>>>>
<<<<<<< @Bean public DispatcherServletPathProvider mainDispatcherServletPathProvider() { return () -> DispatcherServletConfiguration.this.webMvcProperties.getServlet() .getPath(); } ======= >>>>>>>
<<<<<<< /* Fields that can be updated */ public static final String[] FIELDS_TO_COMPARE = { "screen_name", "link", "text" // can embed rich content }; public static PushReport saveMessagesAndImportProfile(List<Map<String, Object>> messages, int fileHash, RemoteAccess.Post post, SourceType sourceType) throws IOException { ======= public static PushReport saveMessagesAndImportProfile( List<Map<String, Object>> messages, int fileHash, RemoteAccess.Post post, SourceType sourceType, String screenName) throws IOException { >>>>>>> /* Fields that can be updated */ public static final String[] FIELDS_TO_COMPARE = { "screen_name", "link", "text" // can embed rich content }; public static PushReport saveMessagesAndImportProfile( List<Map<String, Object>> messages, int fileHash, RemoteAccess.Post post, SourceType sourceType, String screenName) throws IOException {
<<<<<<< ActiveMQXAConnectionFactory connectionFactory = new ActiveMQConnectionFactoryFactory( properties, factoryCustomizers.orderedStream().collect(Collectors.toList())) .createConnectionFactory(ActiveMQXAConnectionFactory.class); ======= ActiveMQXAConnectionFactory connectionFactory = new ActiveMQConnectionFactoryFactory(properties, factoryCustomizers.getIfAvailable()).createConnectionFactory(ActiveMQXAConnectionFactory.class); >>>>>>> ActiveMQXAConnectionFactory connectionFactory = new ActiveMQConnectionFactoryFactory(properties, factoryCustomizers.orderedStream().collect(Collectors.toList())) .createConnectionFactory(ActiveMQXAConnectionFactory.class); <<<<<<< @ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled", havingValue = "false", matchIfMissing = true) public ActiveMQConnectionFactory nonXaJmsConnectionFactory( ActiveMQProperties properties, ObjectProvider<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) { return new ActiveMQConnectionFactoryFactory(properties, factoryCustomizers.orderedStream().collect(Collectors.toList())) .createConnectionFactory(ActiveMQConnectionFactory.class); ======= @ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled", havingValue = "false", matchIfMissing = true) public ActiveMQConnectionFactory nonXaJmsConnectionFactory(ActiveMQProperties properties, ObjectProvider<List<ActiveMQConnectionFactoryCustomizer>> factoryCustomizers) { return new ActiveMQConnectionFactoryFactory(properties, factoryCustomizers.getIfAvailable()) .createConnectionFactory(ActiveMQConnectionFactory.class); >>>>>>> @ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled", havingValue = "false", matchIfMissing = true) public ActiveMQConnectionFactory nonXaJmsConnectionFactory(ActiveMQProperties properties, ObjectProvider<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) { return new ActiveMQConnectionFactoryFactory(properties, factoryCustomizers.orderedStream().collect(Collectors.toList())) .createConnectionFactory(ActiveMQConnectionFactory.class);
<<<<<<< @Test void specificSecurityProtocolOverridesCommonSecurityProtocol() { this.contextRunner.withPropertyValues("spring.kafka.security.protocol=SSL", "spring.kafka.admin.security.protocol=PLAINTEXT").run((context) -> { DefaultKafkaProducerFactory<?, ?> producerFactory = context .getBean(DefaultKafkaProducerFactory.class); Map<String, Object> producerConfigs = producerFactory.getConfigurationProperties(); assertThat(producerConfigs.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)).isEqualTo("SSL"); KafkaAdmin admin = context.getBean(KafkaAdmin.class); Map<String, Object> configs = admin.getConfig(); assertThat(configs.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)).isEqualTo("PLAINTEXT"); }); } ======= @Test void testConcurrentKafkaListenerContainerFactoryWithCustomConsumerFactory() { this.contextRunner.withUserConfiguration(ConsumerFactoryConfiguration.class).run((context) -> { ConcurrentKafkaListenerContainerFactory<?, ?> kafkaListenerContainerFactory = context .getBean(ConcurrentKafkaListenerContainerFactory.class); assertThat(kafkaListenerContainerFactory.getConsumerFactory()) .isNotSameAs(context.getBean(ConsumerFactoryConfiguration.class).consumerFactory); }); } >>>>>>> @Test void testConcurrentKafkaListenerContainerFactoryWithCustomConsumerFactory() { this.contextRunner.withUserConfiguration(ConsumerFactoryConfiguration.class).run((context) -> { ConcurrentKafkaListenerContainerFactory<?, ?> kafkaListenerContainerFactory = context .getBean(ConcurrentKafkaListenerContainerFactory.class); assertThat(kafkaListenerContainerFactory.getConsumerFactory()) .isNotSameAs(context.getBean(ConsumerFactoryConfiguration.class).consumerFactory); }); } @Test void specificSecurityProtocolOverridesCommonSecurityProtocol() { this.contextRunner.withPropertyValues("spring.kafka.security.protocol=SSL", "spring.kafka.admin.security.protocol=PLAINTEXT").run((context) -> { DefaultKafkaProducerFactory<?, ?> producerFactory = context .getBean(DefaultKafkaProducerFactory.class); Map<String, Object> producerConfigs = producerFactory.getConfigurationProperties(); assertThat(producerConfigs.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)).isEqualTo("SSL"); KafkaAdmin admin = context.getBean(KafkaAdmin.class); Map<String, Object> configs = admin.getConfig(); assertThat(configs.get(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)).isEqualTo("PLAINTEXT"); }); }
<<<<<<< import java.util.Arrays; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; ======= import org.junit.Test; >>>>>>> import org.junit.jupiter.api.Test; <<<<<<< import org.springframework.boot.actuate.endpoint.EndpointId; import org.springframework.boot.actuate.endpoint.http.ActuatorMediaType; import org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper; import org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver; import org.springframework.boot.actuate.endpoint.web.EndpointMapping; import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes; import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer; import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping; ======= >>>>>>> <<<<<<< @Bean WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping() { List<String> mediaTypes = Arrays.asList(MediaType.APPLICATION_JSON_VALUE, ActuatorMediaType.V2_JSON); EndpointMediaTypes endpointMediaTypes = new EndpointMediaTypes(mediaTypes, mediaTypes); WebEndpointDiscoverer discoverer = new WebEndpointDiscoverer(this.applicationContext, new ConversionServiceParameterValueMapper(), endpointMediaTypes, Arrays.asList(EndpointId::toString), Collections.emptyList(), Collections.emptyList()); return new WebMvcEndpointHandlerMapping(new EndpointMapping("/actuator"), discoverer.getEndpoints(), endpointMediaTypes, new CorsConfiguration(), new EndpointLinksResolver(discoverer.getEndpoints()), true); } ======= >>>>>>>
<<<<<<< @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "spring.mvc.servlet.path=/spring" }) class ServletPathSampleActuatorApplicationTests { ======= @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "spring.mvc.servlet.path=/spring" }) public class ServletPathSampleActuatorApplicationTests { >>>>>>> @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "spring.mvc.servlet.path=/spring" }) class ServletPathSampleActuatorApplicationTests { <<<<<<< void testHealth() { ResponseEntity<String> entity = this.restTemplate .withBasicAuth("user", getPassword()) ======= public void testHealth() { ResponseEntity<String> entity = this.restTemplate.withBasicAuth("user", getPassword()) >>>>>>> void testHealth() { ResponseEntity<String> entity = this.restTemplate.withBasicAuth("user", getPassword())
<<<<<<< welcomePageHandlerMapping.setInterceptors(getInterceptors(mvcConversionService, mvcResourceUrlProvider)); ======= welcomePageHandlerMapping.setInterceptors(getInterceptors()); welcomePageHandlerMapping.setCorsConfigurations(getCorsConfigurations()); >>>>>>> welcomePageHandlerMapping.setInterceptors(getInterceptors(mvcConversionService, mvcResourceUrlProvider)); welcomePageHandlerMapping.setCorsConfigurations(getCorsConfigurations());
<<<<<<< public ControllerEndpointDiscoverer webEndpointDiscoverer( ApplicationContext applicationContext) { return new ControllerEndpointDiscoverer(applicationContext, null, Collections.emptyList()); ======= public ControllerEndpointDiscoverer webEndpointDiscoverer(ApplicationContext applicationContext) { return new ControllerEndpointDiscoverer(applicationContext, PathMapper.useEndpointId(), Collections.emptyList()); >>>>>>> public ControllerEndpointDiscoverer webEndpointDiscoverer(ApplicationContext applicationContext) { return new ControllerEndpointDiscoverer(applicationContext, null, Collections.emptyList());
<<<<<<< this.contextRunner.withUserConfiguration(CustomMessageSourceConfiguration.class) .run((context) -> assertThat(context.getMessage("foo", null, null, null)) .isEqualTo("foo")); ======= this.contextRunner.withUserConfiguration(CustomMessageSource.class) .run((context) -> assertThat(context.getMessage("foo", null, null, null)).isEqualTo("foo")); >>>>>>> this.contextRunner.withUserConfiguration(CustomMessageSourceConfiguration.class) .run((context) -> assertThat(context.getMessage("foo", null, null, null)).isEqualTo("foo")); <<<<<<< return new TestMessageSource(); } } @Configuration(proxyBeanMethods = false) protected static class CustomBeanNameMessageSourceConfiguration { @Bean public MessageSource codeReturningMessageSource() { return new TestMessageSource(); } } private static class TestMessageSource implements MessageSource { @Override public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) { return code; } @Override public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException { return code; } @Override public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException { return resolvable.getCodes()[0]; ======= return new MessageSource() { @Override public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) { return code; } @Override public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException { return code; } @Override public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException { return resolvable.getCodes()[0]; } }; >>>>>>> return new TestMessageSource(); } } @Configuration(proxyBeanMethods = false) protected static class CustomBeanNameMessageSourceConfiguration { @Bean public MessageSource codeReturningMessageSource() { return new TestMessageSource(); } } private static class TestMessageSource implements MessageSource { @Override public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) { return code; } @Override public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException { return code; } @Override public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException { return resolvable.getCodes()[0];
<<<<<<< mProgressDialog = ProgressDialog.show(mActivity.get(), "Download", "downloading via Handlers and Messages"); ======= mActivity.get().showDialog("downloading via Runnables and Messages"); >>>>>>> mActivity.get().showDialog("downloading via Handlers and Messages");
<<<<<<< private final Map<SerializationFeature, Boolean> serialization = new EnumMap<>( SerializationFeature.class); ======= private Map<SerializationFeature, Boolean> serialization = new EnumMap<>(SerializationFeature.class); >>>>>>> private final Map<SerializationFeature, Boolean> serialization = new EnumMap<>(SerializationFeature.class); <<<<<<< private final Map<DeserializationFeature, Boolean> deserialization = new EnumMap<>( DeserializationFeature.class); ======= private Map<DeserializationFeature, Boolean> deserialization = new EnumMap<>(DeserializationFeature.class); >>>>>>> private final Map<DeserializationFeature, Boolean> deserialization = new EnumMap<>(DeserializationFeature.class); <<<<<<< private final Map<JsonParser.Feature, Boolean> parser = new EnumMap<>( JsonParser.Feature.class); ======= private Map<JsonParser.Feature, Boolean> parser = new EnumMap<>(JsonParser.Feature.class); >>>>>>> private final Map<JsonParser.Feature, Boolean> parser = new EnumMap<>(JsonParser.Feature.class); <<<<<<< private final Map<JsonGenerator.Feature, Boolean> generator = new EnumMap<>( JsonGenerator.Feature.class); ======= private Map<JsonGenerator.Feature, Boolean> generator = new EnumMap<>(JsonGenerator.Feature.class); >>>>>>> private final Map<JsonGenerator.Feature, Boolean> generator = new EnumMap<>(JsonGenerator.Feature.class);
<<<<<<< public ServletEndpointDiscoverer servletEndpointDiscoverer( ApplicationContext applicationContext) { return new ServletEndpointDiscoverer(applicationContext, null, Collections.emptyList()); ======= public ServletEndpointDiscoverer servletEndpointDiscoverer(ApplicationContext applicationContext) { return new ServletEndpointDiscoverer(applicationContext, PathMapper.useEndpointId(), Collections.emptyList()); >>>>>>> public ServletEndpointDiscoverer servletEndpointDiscoverer(ApplicationContext applicationContext) { return new ServletEndpointDiscoverer(applicationContext, null, Collections.emptyList());
<<<<<<< void defaultFilterConfiguration() throws IOException { ScannedGenericBeanDefinition scanned = new ScannedGenericBeanDefinition( new SimpleMetadataReaderFactory().getMetadataReader(DefaultConfigurationFilter.class.getName())); this.handler.handle(scanned, this.registry); ======= public void defaultFilterConfiguration() throws IOException { AnnotatedBeanDefinition definition = createBeanDefinition(DefaultConfigurationFilter.class); this.handler.handle(definition, this.registry); >>>>>>> void defaultFilterConfiguration() throws IOException { AnnotatedBeanDefinition definition = createBeanDefinition(DefaultConfigurationFilter.class); this.handler.handle(definition, this.registry); <<<<<<< void filterWithCustomName() throws IOException { ScannedGenericBeanDefinition scanned = new ScannedGenericBeanDefinition( new SimpleMetadataReaderFactory().getMetadataReader(CustomNameFilter.class.getName())); this.handler.handle(scanned, this.registry); ======= public void filterWithCustomName() throws IOException { AnnotatedBeanDefinition definition = createBeanDefinition(CustomNameFilter.class); this.handler.handle(definition, this.registry); >>>>>>> void filterWithCustomName() throws IOException { AnnotatedBeanDefinition definition = createBeanDefinition(CustomNameFilter.class); this.handler.handle(definition, this.registry); <<<<<<< void asyncSupported() throws IOException { BeanDefinition filterRegistrationBean = getBeanDefinition(AsyncSupportedFilter.class); ======= public void asyncSupported() throws IOException { BeanDefinition filterRegistrationBean = handleBeanDefinitionForClass(AsyncSupportedFilter.class); >>>>>>> void asyncSupported() throws IOException { BeanDefinition filterRegistrationBean = handleBeanDefinitionForClass(AsyncSupportedFilter.class); <<<<<<< void dispatcherTypes() throws IOException { BeanDefinition filterRegistrationBean = getBeanDefinition(DispatcherTypesFilter.class); ======= public void dispatcherTypes() throws IOException { BeanDefinition filterRegistrationBean = handleBeanDefinitionForClass(DispatcherTypesFilter.class); >>>>>>> void dispatcherTypes() throws IOException { BeanDefinition filterRegistrationBean = handleBeanDefinitionForClass(DispatcherTypesFilter.class); <<<<<<< void initParameters() throws IOException { BeanDefinition filterRegistrationBean = getBeanDefinition(InitParametersFilter.class); ======= public void initParameters() throws IOException { BeanDefinition filterRegistrationBean = handleBeanDefinitionForClass(InitParametersFilter.class); >>>>>>> void initParameters() throws IOException { BeanDefinition filterRegistrationBean = handleBeanDefinitionForClass(InitParametersFilter.class); <<<<<<< void servletNames() throws IOException { BeanDefinition filterRegistrationBean = getBeanDefinition(ServletNamesFilter.class); ======= public void servletNames() throws IOException { BeanDefinition filterRegistrationBean = handleBeanDefinitionForClass(ServletNamesFilter.class); >>>>>>> void servletNames() throws IOException { BeanDefinition filterRegistrationBean = handleBeanDefinitionForClass(ServletNamesFilter.class);
<<<<<<< import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.DisposableBean; ======= >>>>>>> import org.springframework.beans.factory.BeanCreationException; <<<<<<< import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory.MockEmbeddedServletContainer; import org.springframework.boot.context.web.ServerPortInfoApplicationContextInitializer; ======= >>>>>>> import org.springframework.boot.context.web.ServerPortInfoApplicationContextInitializer; <<<<<<< @Test public void containerIsStoppedBeforeContextIsClosed() { addEmbeddedServletContainerFactoryBean(); this.context.registerBeanDefinition("shutdownOrderingValidator", BeanDefinitionBuilder.rootBeanDefinition(ShutdownOrderingValidator.class) .addConstructorArgReference("embeddedServletContainerFactory") .getBeanDefinition()); this.context.refresh(); ShutdownOrderingValidator validator = this.context .getBean(ShutdownOrderingValidator.class); this.context.close(); assertThat(validator.destroyed, is(true)); assertThat(validator.containerStoppedFirst, is(true)); } ======= >>>>>>>
<<<<<<< ======= private final Map<String, RedisConnectionFactory> redisConnectionFactories; public RedisHealthIndicatorAutoConfiguration(Map<String, RedisConnectionFactory> redisConnectionFactories) { this.redisConnectionFactories = redisConnectionFactories; } >>>>>>>
<<<<<<< import java.io.IOException; import java.nio.charset.Charset; import java.util.Iterator; import java.util.Set; import org.springframework.boot.autoconfigure.MessageSourceAutoConfiguration.ResourceBundleCondition; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; ======= import static org.springframework.util.StringUtils.commaDelimitedListToStringArray; import static org.springframework.util.StringUtils.trimAllWhitespace; >>>>>>> import static org.springframework.util.StringUtils.commaDelimitedListToStringArray; import static org.springframework.util.StringUtils.trimAllWhitespace; import java.io.IOException; import java.nio.charset.Charset; import java.util.Iterator; import java.util.Set; import org.springframework.boot.autoconfigure.MessageSourceAutoConfiguration.ResourceBundleCondition; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; <<<<<<< import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; ======= import org.springframework.boot.autoconfigure.condition.SearchStrategy; import org.springframework.boot.bind.RelaxedPropertyResolver; import org.springframework.context.EnvironmentAware; >>>>>>> import org.springframework.boot.autoconfigure.condition.SearchStrategy; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; <<<<<<< @ConditionalOnMissingBean(MessageSource.class) @AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @Conditional(ResourceBundleCondition.class) @EnableConfigurationProperties @ConfigurationProperties(prefix = "spring.messages") public class MessageSourceAutoConfiguration { ======= @ConditionalOnMissingBean(value=MessageSource.class, search=SearchStrategy.CURRENT) @Order(Ordered.HIGHEST_PRECEDENCE) public class MessageSourceAutoConfiguration implements EnvironmentAware { >>>>>>> @ConditionalOnMissingBean(value=MessageSource.class, search=SearchStrategy.CURRENT) @AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) @Conditional(ResourceBundleCondition.class) @EnableConfigurationProperties @ConfigurationProperties(prefix = "spring.messages") public class MessageSourceAutoConfiguration { <<<<<<< .setBasenames(commaDelimitedListToStringArray(trimAllWhitespace(this.basename))); ======= .setBasenames(commaDelimitedListToStringArray(trimAllWhitespace(basename))); >>>>>>> .setBasenames(commaDelimitedListToStringArray(trimAllWhitespace(this.basename)));
<<<<<<< List<File> resolved = this.resolver.resolve(Arrays.asList("junit:junit:4.11", "commons-logging:commons-logging:1.1.3")); assertThat(resolved).hasSize(4); assertThat(getNames(resolved)).containsOnly("junit-4.11.jar", "commons-logging-1.1.3.jar", "hamcrest-core-2.1.jar", "hamcrest-2.1.jar"); ======= List<File> resolved = this.resolver .resolve(Arrays.asList("junit:junit:4.11", "commons-logging:commons-logging:1.1.3")); assertThat(resolved).hasSize(3); assertThat(getNames(resolved)).containsOnly("junit-4.11.jar", "commons-logging-1.1.3.jar", "hamcrest-core-1.3.jar"); >>>>>>> List<File> resolved = this.resolver .resolve(Arrays.asList("junit:junit:4.11", "commons-logging:commons-logging:1.1.3")); assertThat(resolved).hasSize(4); assertThat(getNames(resolved)).containsOnly("junit-4.11.jar", "commons-logging-1.1.3.jar", "hamcrest-core-2.1.jar", "hamcrest-2.1.jar");
<<<<<<< @Override public <T> T accept(SweDataComponentVisitor<T> visitor) throws OwsExceptionReport { return visitor.visit(this); } @Override public void accept(VoidSweDataComponentVisitor visitor) throws OwsExceptionReport { visitor.visit(this); } ======= public void increaseCount() { value++; } public void increaseCount(int count) { value += count; } >>>>>>> public void increaseCount() { value++; } public void increaseCount(int count) { value += count; } @Override public <T> T accept(SweDataComponentVisitor<T> visitor) throws OwsExceptionReport { return visitor.visit(this); } @Override public void accept(VoidSweDataComponentVisitor visitor) throws OwsExceptionReport { visitor.visit(this); }
<<<<<<< this.contextRunner.withPropertyValues("spring.thymeleaf.suffix:.html") .run((context) -> { TemplateEngine engine = context.getBean(TemplateEngine.class); Context attrs = new Context(Locale.UK, Collections.singletonMap("foo", "bar")); String result = engine.process("template", attrs); assertThat(result).isEqualTo("<html>bar</html>"); }); ======= load(BaseConfiguration.class, "spring.thymeleaf.suffix:.html"); TemplateEngine engine = this.context.getBean(TemplateEngine.class); Context attrs = new Context(Locale.UK, Collections.singletonMap("foo", "bar")); String result = engine.process("template", attrs).trim(); assertThat(result).isEqualTo("<html>bar</html>"); >>>>>>> this.contextRunner.withPropertyValues("spring.thymeleaf.suffix:.html") .run((context) -> { TemplateEngine engine = context.getBean(TemplateEngine.class); Context attrs = new Context(Locale.UK, Collections.singletonMap("foo", "bar")); String result = engine.process("template", attrs).trim(); assertThat(result).isEqualTo("<html>bar</html>"); }); <<<<<<< this.contextRunner.run((context) -> { ISpringWebFluxTemplateEngine engine = context .getBean(ISpringWebFluxTemplateEngine.class); Context attrs = new Context(Locale.UK, Collections.singletonMap("foo", "bar")); String result = engine.process("data-dialect", attrs); assertThat(result).isEqualTo("<html><body data-foo=\"bar\"></body></html>"); }); ======= load(BaseConfiguration.class); ISpringWebFluxTemplateEngine engine = this.context .getBean(ISpringWebFluxTemplateEngine.class); Context attrs = new Context(Locale.UK, Collections.singletonMap("foo", "bar")); String result = engine.process("data-dialect", attrs).trim(); assertThat(result).isEqualTo("<html><body data-foo=\"bar\"></body></html>"); >>>>>>> this.contextRunner.run((context) -> { ISpringWebFluxTemplateEngine engine = context .getBean(ISpringWebFluxTemplateEngine.class); Context attrs = new Context(Locale.UK, Collections.singletonMap("foo", "bar")); String result = engine.process("data-dialect", attrs).trim(); assertThat(result).isEqualTo("<html><body data-foo=\"bar\"></body></html>"); });
<<<<<<< { public PA_Task_RequiresBleOn(BleDevice device, double timeout, I_StateListener listener) { super(device, timeout, listener); } public PA_Task_RequiresBleOn(BleServer server, I_StateListener listener) { super(server, listener); } ======= { >>>>>>> { public PA_Task_RequiresBleOn(BleServer server, I_StateListener listener) { super(server, listener); }
<<<<<<< import javax.net.ssl.SSLHandshakeException; import org.junit.jupiter.api.Test; ======= import org.junit.Test; >>>>>>> import org.junit.jupiter.api.Test; <<<<<<< @Test void whenSslIsConfiguredWithAnInvalidAliasTheSslHandshakeFails() { Mono<String> result = testSslWithAlias("test-alias-bad"); StepVerifier.setDefaultTimeout(Duration.ofSeconds(30)); StepVerifier.create(result).expectErrorMatches((throwable) -> throwable instanceof SSLHandshakeException && throwable.getMessage().contains("HANDSHAKE_FAILURE")).verify(); } ======= >>>>>>>
<<<<<<< public ReviewsSummaryImpl(List<RatingCount> ratingCounts) { this.ratingCount = new HashMap<>(); ======= ReviewsSummaryImpl(List<RatingCount> ratingCounts) { this.ratingCount = new HashMap<Rating, Long>(); >>>>>>> ReviewsSummaryImpl(List<RatingCount> ratingCounts) { this.ratingCount = new HashMap<>();
<<<<<<< this.webContext = new AnnotationConfigServletWebApplicationContext(); TestPropertyValues.of("spring.mustache.prefix=classpath:/mustache-templates/") .applyTo(this.webContext); ======= this.webContext = new AnnotationConfigWebApplicationContext(); TestPropertyValues.of("spring.mustache.prefix=classpath:/mustache-templates/").applyTo(this.webContext); >>>>>>> this.webContext = new AnnotationConfigServletWebApplicationContext(); TestPropertyValues.of("spring.mustache.prefix=classpath:/mustache-templates/").applyTo(this.webContext);
<<<<<<< import java.util.Collections; ======= import java.util.Collection; >>>>>>> import java.util.Collection; import java.util.Collections; <<<<<<< import java.util.Map; ======= import java.util.Map; import java.util.Map.Entry; import java.util.Set; >>>>>>> import java.util.Map; import java.util.Map.Entry; import java.util.Set; <<<<<<< import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; ======= import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.is; >>>>>>> import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.is; <<<<<<< @Test public void persistSession() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); factory.setPersistSession(true); this.container = factory .getEmbeddedServletContainer(sessionServletRegistration()); this.container.start(); String s1 = getResponse(getLocalUrl("/session")); String s2 = getResponse(getLocalUrl("/session")); this.container.stop(); this.container = factory .getEmbeddedServletContainer(sessionServletRegistration()); this.container.start(); String s3 = getResponse(getLocalUrl("/session")); System.out.println(s1); System.out.println(s2); System.out.println(s3); String message = "Session error s1=" + s1 + " s2=" + s2 + " s3=" + s3; assertThat(message, s2.split(":")[0], equalTo(s1.split(":")[1])); assertThat(message, s3.split(":")[0], equalTo(s2.split(":")[1])); } @Test public void persistSessionInSpecificSessionStoreDir() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); File sessionStoreDir = this.temporaryFolder.newFolder(); factory.setPersistSession(true); factory.setSessionStoreDir(sessionStoreDir); this.container = factory .getEmbeddedServletContainer(sessionServletRegistration()); this.container.start(); getResponse(getLocalUrl("/session")); this.container.stop(); File[] dirContents = sessionStoreDir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return !(".".equals(name) || "..".equals(name)); } }); assertThat(dirContents.length, greaterThan(0)); } @Test public void getValidSessionStoreWhenSessionStoreNotSet() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); File dir = factory.getValidSessionStoreDir(false); assertThat(dir.getName(), equalTo("servlet-sessions")); assertThat(dir.getParentFile(), equalTo(new ApplicationTemp().getDir())); } @Test public void getValidSessionStoreWhenSessionStoreIsRelative() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); factory.setSessionStoreDir(new File("sessions")); File dir = factory.getValidSessionStoreDir(false); assertThat(dir.getName(), equalTo("sessions")); assertThat(dir.getParentFile(), equalTo(new ApplicationHome().getDir())); } @Test public void getValidSessionStoreWhenSessionStoreReferencesFile() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); factory.setSessionStoreDir(this.temporaryFolder.newFile()); this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("points to a file"); factory.getValidSessionStoreDir(false); } @Test public void compression() throws Exception { assertTrue(doTestCompression(10000, null, null)); } @Test public void noCompressionForSmallResponse() throws Exception { assertFalse(doTestCompression(100, null, null)); } @Test public void noCompressionForMimeType() throws Exception { String[] mimeTypes = new String[] { "text/html", "text/xml", "text/css" }; assertFalse(doTestCompression(10000, mimeTypes, null)); } @Test public void noCompressionForUserAgent() throws Exception { assertFalse(doTestCompression(10000, null, new String[] { "testUserAgent" })); } private boolean doTestCompression(int contentSize, String[] mimeTypes, String[] excludedUserAgents) throws Exception { String testContent = setUpFactoryForCompression(contentSize, mimeTypes, excludedUserAgents); TestGzipInputStreamFactory inputStreamFactory = new TestGzipInputStreamFactory(); Map<String, InputStreamFactory> contentDecoderMap = Collections .singletonMap("gzip", (InputStreamFactory) inputStreamFactory); String response = getResponse(getLocalUrl("/test.txt"), new HttpComponentsClientHttpRequestFactory( HttpClientBuilder.create().setUserAgent("testUserAgent") .setContentDecoderRegistry(contentDecoderMap).build())); assertThat(response, equalTo(testContent)); return inputStreamFactory.wasCompressionUsed(); } protected String setUpFactoryForCompression(int contentSize, String[] mimeTypes, String[] excludedUserAgents) throws Exception { char[] chars = new char[contentSize]; Arrays.fill(chars, 'F'); String testContent = new String(chars); AbstractEmbeddedServletContainerFactory factory = getFactory(); FileCopyUtils.copy(testContent, new FileWriter(this.temporaryFolder.newFile("test.txt"))); factory.setDocumentRoot(this.temporaryFolder.getRoot()); Compression compression = new Compression(); compression.setEnabled(true); if (mimeTypes != null) { compression.setMimeTypes(mimeTypes); } if (excludedUserAgents != null) { compression.setExcludedUserAgents(excludedUserAgents); } factory.setCompression(compression); this.container = factory.getEmbeddedServletContainer(); this.container.start(); return testContent; } ======= @Test public void mimeMappingsAreCorrectlyConfigured() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); this.container = factory.getEmbeddedServletContainer(); Map<String, String> configuredMimeMappings = getActualMimeMappings(); Set<Entry<String, String>> entrySet = configuredMimeMappings.entrySet(); Collection<MimeMappings.Mapping> expectedMimeMappings = getExpectedMimeMappings(); for (Entry<String, String> entry : entrySet) { assertThat(expectedMimeMappings, hasItem(new MimeMappings.Mapping(entry.getKey(), entry.getValue()))); } for (MimeMappings.Mapping mapping : expectedMimeMappings) { assertThat(configuredMimeMappings, hasEntry(mapping.getExtension(), mapping.getMimeType())); } assertThat(configuredMimeMappings.size(), is(equalTo(expectedMimeMappings.size()))); } protected abstract Map<String, String> getActualMimeMappings(); protected Collection<MimeMappings.Mapping> getExpectedMimeMappings() { return MimeMappings.DEFAULT.getAll(); } >>>>>>> @Test public void persistSession() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); factory.setPersistSession(true); this.container = factory .getEmbeddedServletContainer(sessionServletRegistration()); this.container.start(); String s1 = getResponse(getLocalUrl("/session")); String s2 = getResponse(getLocalUrl("/session")); this.container.stop(); this.container = factory .getEmbeddedServletContainer(sessionServletRegistration()); this.container.start(); String s3 = getResponse(getLocalUrl("/session")); System.out.println(s1); System.out.println(s2); System.out.println(s3); String message = "Session error s1=" + s1 + " s2=" + s2 + " s3=" + s3; assertThat(message, s2.split(":")[0], equalTo(s1.split(":")[1])); assertThat(message, s3.split(":")[0], equalTo(s2.split(":")[1])); } @Test public void persistSessionInSpecificSessionStoreDir() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); File sessionStoreDir = this.temporaryFolder.newFolder(); factory.setPersistSession(true); factory.setSessionStoreDir(sessionStoreDir); this.container = factory .getEmbeddedServletContainer(sessionServletRegistration()); this.container.start(); getResponse(getLocalUrl("/session")); this.container.stop(); File[] dirContents = sessionStoreDir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return !(".".equals(name) || "..".equals(name)); } }); assertThat(dirContents.length, greaterThan(0)); } @Test public void getValidSessionStoreWhenSessionStoreNotSet() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); File dir = factory.getValidSessionStoreDir(false); assertThat(dir.getName(), equalTo("servlet-sessions")); assertThat(dir.getParentFile(), equalTo(new ApplicationTemp().getDir())); } @Test public void getValidSessionStoreWhenSessionStoreIsRelative() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); factory.setSessionStoreDir(new File("sessions")); File dir = factory.getValidSessionStoreDir(false); assertThat(dir.getName(), equalTo("sessions")); assertThat(dir.getParentFile(), equalTo(new ApplicationHome().getDir())); } @Test public void getValidSessionStoreWhenSessionStoreReferencesFile() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); factory.setSessionStoreDir(this.temporaryFolder.newFile()); this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("points to a file"); factory.getValidSessionStoreDir(false); } @Test public void compression() throws Exception { assertTrue(doTestCompression(10000, null, null)); } @Test public void noCompressionForSmallResponse() throws Exception { assertFalse(doTestCompression(100, null, null)); } @Test public void noCompressionForMimeType() throws Exception { String[] mimeTypes = new String[] { "text/html", "text/xml", "text/css" }; assertFalse(doTestCompression(10000, mimeTypes, null)); } @Test public void noCompressionForUserAgent() throws Exception { assertFalse(doTestCompression(10000, null, new String[] { "testUserAgent" })); } @Test public void mimeMappingsAreCorrectlyConfigured() throws Exception { AbstractEmbeddedServletContainerFactory factory = getFactory(); this.container = factory.getEmbeddedServletContainer(); Map<String, String> configuredMimeMappings = getActualMimeMappings(); Set<Entry<String, String>> entrySet = configuredMimeMappings.entrySet(); Collection<MimeMappings.Mapping> expectedMimeMappings = getExpectedMimeMappings(); for (Entry<String, String> entry : entrySet) { assertThat(expectedMimeMappings, hasItem(new MimeMappings.Mapping(entry.getKey(), entry.getValue()))); } for (MimeMappings.Mapping mapping : expectedMimeMappings) { assertThat(configuredMimeMappings, hasEntry(mapping.getExtension(), mapping.getMimeType())); } assertThat(configuredMimeMappings.size(), is(equalTo(expectedMimeMappings.size()))); } private boolean doTestCompression(int contentSize, String[] mimeTypes, String[] excludedUserAgents) throws Exception { String testContent = setUpFactoryForCompression(contentSize, mimeTypes, excludedUserAgents); TestGzipInputStreamFactory inputStreamFactory = new TestGzipInputStreamFactory(); Map<String, InputStreamFactory> contentDecoderMap = Collections .singletonMap("gzip", (InputStreamFactory) inputStreamFactory); String response = getResponse(getLocalUrl("/test.txt"), new HttpComponentsClientHttpRequestFactory( HttpClientBuilder.create().setUserAgent("testUserAgent") .setContentDecoderRegistry(contentDecoderMap).build())); assertThat(response, equalTo(testContent)); return inputStreamFactory.wasCompressionUsed(); } protected String setUpFactoryForCompression(int contentSize, String[] mimeTypes, String[] excludedUserAgents) throws Exception { char[] chars = new char[contentSize]; Arrays.fill(chars, 'F'); String testContent = new String(chars); AbstractEmbeddedServletContainerFactory factory = getFactory(); FileCopyUtils.copy(testContent, new FileWriter(this.temporaryFolder.newFile("test.txt"))); factory.setDocumentRoot(this.temporaryFolder.getRoot()); Compression compression = new Compression(); compression.setEnabled(true); if (mimeTypes != null) { compression.setMimeTypes(mimeTypes); } if (excludedUserAgents != null) { compression.setExcludedUserAgents(excludedUserAgents); } factory.setCompression(compression); this.container = factory.getEmbeddedServletContainer(); this.container.start(); return testContent; } protected abstract Map<String, String> getActualMimeMappings(); protected Collection<MimeMappings.Mapping> getExpectedMimeMappings() { return MimeMappings.DEFAULT.getAll(); }
<<<<<<< void createWhenVinIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new VehicleIdentificationNumber(null)) ======= public void createWhenVinIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new VehicleIdentificationNumber(null)) >>>>>>> void createWhenVinIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new VehicleIdentificationNumber(null))
<<<<<<< import com.idevicesinc.sweetblue.BleServer.ReadOrWriteRequestListener; ======= import com.idevicesinc.sweetblue.PA_StateTracker.E_Intent; >>>>>>> import com.idevicesinc.sweetblue.BleServer.ReadOrWriteRequestListener; import com.idevicesinc.sweetblue.PA_StateTracker.E_Intent; <<<<<<< private final Context m_context; final Handler m_mainThreadHandler; private final BluetoothManager m_btMngr; private final P_AdvertisingFilterManager m_filterMngr; private final P_BluetoothCrashResolver m_crashResolver; private P_Logger m_logger; BleManagerConfig m_config; final P_DeviceManager m_deviceMngr; final P_ServerManager m_serverMngr; private final P_BleManager_Listeners m_listeners; private final P_StateTracker m_stateTracker; private final P_NativeStateTracker m_nativeStateTracker; private UpdateLoop m_updateLoop; private final P_TaskQueue m_taskQueue; private P_UhOhThrottler m_uhOhThrottler; P_WakeLockManager m_wakeLockMngr; private int m_connectionFailTracker = 0; final Object m_threadLock = new Object(); DiscoveryListener m_discoveryListener; private P_WrappingNukeListener m_nukeListeners; private AssertListener m_assertionListener; BleDevice.StateListener m_defaultDeviceStateListener; BleDevice.ConnectionFailListener m_defaultConnectionFailListener; BleServer.StateListener m_defaultServerStateListener; ======= >>>>>>> <<<<<<< m_serverMngr = new P_ServerManager(this); ======= m_deviceMngr_cache = new P_DeviceManager(this); >>>>>>> m_serverMngr = new P_ServerManager(this); m_deviceMngr_cache = new P_DeviceManager(this);
<<<<<<< ======= private final HttpProperties httpProperties; private final WebMvcProperties webMvcProperties; public DispatcherServletConfiguration(HttpProperties httpProperties, WebMvcProperties webMvcProperties) { this.httpProperties = httpProperties; this.webMvcProperties = webMvcProperties; } >>>>>>> <<<<<<< dispatcherServlet.setDispatchOptionsRequest( webMvcProperties.isDispatchOptionsRequest()); dispatcherServlet .setDispatchTraceRequest(webMvcProperties.isDispatchTraceRequest()); dispatcherServlet.setThrowExceptionIfNoHandlerFound( webMvcProperties.isThrowExceptionIfNoHandlerFound()); dispatcherServlet .setEnableLoggingRequestDetails(httpProperties.isLogRequestDetails()); ======= dispatcherServlet.setDispatchOptionsRequest(this.webMvcProperties.isDispatchOptionsRequest()); dispatcherServlet.setDispatchTraceRequest(this.webMvcProperties.isDispatchTraceRequest()); dispatcherServlet .setThrowExceptionIfNoHandlerFound(this.webMvcProperties.isThrowExceptionIfNoHandlerFound()); dispatcherServlet.setEnableLoggingRequestDetails(this.httpProperties.isLogRequestDetails()); >>>>>>> dispatcherServlet.setDispatchOptionsRequest(webMvcProperties.isDispatchOptionsRequest()); dispatcherServlet.setDispatchTraceRequest(webMvcProperties.isDispatchTraceRequest()); dispatcherServlet.setThrowExceptionIfNoHandlerFound(webMvcProperties.isThrowExceptionIfNoHandlerFound()); dispatcherServlet.setEnableLoggingRequestDetails(httpProperties.isLogRequestDetails()); <<<<<<< ======= private final WebMvcProperties webMvcProperties; private final MultipartConfigElement multipartConfig; public DispatcherServletRegistrationConfiguration(WebMvcProperties webMvcProperties, ObjectProvider<MultipartConfigElement> multipartConfigProvider) { this.webMvcProperties = webMvcProperties; this.multipartConfig = multipartConfigProvider.getIfAvailable(); } >>>>>>> <<<<<<< @ConditionalOnBean(value = DispatcherServlet.class, name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME) public DispatcherServletRegistrationBean dispatcherServletRegistration( DispatcherServlet dispatcherServlet, WebMvcProperties webMvcProperties, ObjectProvider<MultipartConfigElement> multipartConfig) { DispatcherServletRegistrationBean registration = new DispatcherServletRegistrationBean( dispatcherServlet, webMvcProperties.getServlet().getPath()); ======= @ConditionalOnBean(value = DispatcherServlet.class, name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME) public DispatcherServletRegistrationBean dispatcherServletRegistration(DispatcherServlet dispatcherServlet) { DispatcherServletRegistrationBean registration = new DispatcherServletRegistrationBean(dispatcherServlet, this.webMvcProperties.getServlet().getPath()); >>>>>>> @ConditionalOnBean(value = DispatcherServlet.class, name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME) public DispatcherServletRegistrationBean dispatcherServletRegistration(DispatcherServlet dispatcherServlet, WebMvcProperties webMvcProperties, ObjectProvider<MultipartConfigElement> multipartConfig) { DispatcherServletRegistrationBean registration = new DispatcherServletRegistrationBean(dispatcherServlet, webMvcProperties.getServlet().getPath()); <<<<<<< registration .setLoadOnStartup(webMvcProperties.getServlet().getLoadOnStartup()); multipartConfig.ifAvailable(registration::setMultipartConfig); ======= registration.setLoadOnStartup(this.webMvcProperties.getServlet().getLoadOnStartup()); if (this.multipartConfig != null) { registration.setMultipartConfig(this.multipartConfig); } >>>>>>> registration.setLoadOnStartup(webMvcProperties.getServlet().getLoadOnStartup()); multipartConfig.ifAvailable(registration::setMultipartConfig);
<<<<<<< import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothGatt; ======= >>>>>>> import android.bluetooth.BluetoothGattService; <<<<<<< BleServer.StateListener m_defaultServerStateListener; final P_ServerManager m_serverMngr; private static BleManager s_instance = null; ======= >>>>>>> BleServer.StateListener m_defaultServerStateListener; final P_ServerManager m_serverMngr;