Merge branch '3.3.x'
Closes gh-41616
This commit is contained in:
@@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.pulsar;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.pulsar.client.api.PulsarClientException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.PulsarContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
@@ -106,7 +105,7 @@ class PulsarAutoConfigurationIntegrationTests {
|
||||
}
|
||||
|
||||
@GetMapping("/hello")
|
||||
String sayHello() throws PulsarClientException {
|
||||
String sayHello() {
|
||||
return "Hello World -> " + this.pulsarTemplate.send(TOPIC, "hello");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
import org.apache.pulsar.client.admin.PulsarAdminBuilder;
|
||||
import org.apache.pulsar.client.api.ClientBuilder;
|
||||
import org.apache.pulsar.client.api.PulsarClient;
|
||||
import org.apache.pulsar.client.api.PulsarClientException;
|
||||
import org.apache.pulsar.client.api.Schema;
|
||||
import org.apache.pulsar.common.schema.SchemaType;
|
||||
|
||||
@@ -96,7 +95,7 @@ class PulsarConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
PulsarClient pulsarClient(PulsarClientFactory clientFactory) throws PulsarClientException {
|
||||
PulsarClient pulsarClient(PulsarClientFactory clientFactory) {
|
||||
return clientFactory.createClient();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,13 +35,14 @@ import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.web.client.RestClient;
|
||||
import org.springframework.web.client.RestClient.Builder;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for {@link RestClient}.
|
||||
* <p>
|
||||
* This will produce a {@link RestClient.Builder RestClient.Builder} bean with the
|
||||
* {@code prototype} scope, meaning each injection point will receive a newly cloned
|
||||
* instance of the builder.
|
||||
* This will produce a {@link Builder RestClient.Builder} bean with the {@code prototype}
|
||||
* scope, meaning each injection point will receive a newly cloned instance of the
|
||||
* builder.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Moritz Halbritter
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,7 +23,7 @@ import org.springframework.web.client.RestClient;
|
||||
import org.springframework.web.client.RestClient.Builder;
|
||||
|
||||
/**
|
||||
* Configure {@link RestClient.Builder} with sensible defaults.
|
||||
* Configure {@link Builder RestClient.Builder} with sensible defaults.
|
||||
*
|
||||
* @author Moritz Halbritter
|
||||
* @since 3.2.0
|
||||
@@ -37,9 +37,9 @@ public class RestClientBuilderConfigurer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the specified {@link RestClient.Builder}. The builder can be further
|
||||
* tuned and default settings can be overridden.
|
||||
* @param builder the {@link RestClient.Builder} instance to configure
|
||||
* Configure the specified {@link Builder RestClient.Builder}. The builder can be
|
||||
* further tuned and default settings can be overridden.
|
||||
* @param builder the {@link Builder RestClient.Builder} instance to configure
|
||||
* @return the configured builder
|
||||
*/
|
||||
public RestClient.Builder configure(RestClient.Builder builder) {
|
||||
|
||||
@@ -27,7 +27,6 @@ import graphql.schema.GraphQLObjectType;
|
||||
import graphql.schema.GraphQLOutputType;
|
||||
import graphql.schema.GraphQLSchema;
|
||||
import graphql.schema.idl.RuntimeWiring;
|
||||
import graphql.schema.visibility.DefaultGraphqlFieldVisibility;
|
||||
import org.assertj.core.api.InstanceOfAssertFactories;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -172,20 +171,13 @@ class GraphQlAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
void fieldIntrospectionShouldBeEnabledByDefault() {
|
||||
this.contextRunner.run((context) -> {
|
||||
GraphQlSource graphQlSource = context.getBean(GraphQlSource.class);
|
||||
GraphQLSchema schema = graphQlSource.schema();
|
||||
assertThat(schema.getCodeRegistry().getFieldVisibility()).isInstanceOf(DefaultGraphqlFieldVisibility.class);
|
||||
});
|
||||
this.contextRunner.run((context) -> assertThat(Introspection.isEnabledJvmWide()).isTrue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldDisableFieldIntrospection() {
|
||||
this.contextRunner.withPropertyValues("spring.graphql.schema.introspection.enabled:false").run((context) -> {
|
||||
GraphQlSource graphQlSource = context.getBean(GraphQlSource.class);
|
||||
GraphQLSchema schema = graphQlSource.schema();
|
||||
assertThat(Introspection.isEnabledJvmWide()).isFalse();
|
||||
});
|
||||
this.contextRunner.withPropertyValues("spring.graphql.schema.introspection.enabled:false")
|
||||
.run((context) -> assertThat(Introspection.isEnabledJvmWide()).isFalse());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user