Skip to content

Commit

Permalink
Merge pull request #487 from camunda/renovate/spring-boot
Browse files Browse the repository at this point in the history
fix(deps): update spring boot to v3.0.6
  • Loading branch information
igpetrov authored Apr 21, 2023
2 parents 98726c8 + 8d50755 commit 136963b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import io.camunda.connector.common.constants.Constants;
import io.camunda.connector.common.model.CommonRequest;
import io.camunda.connector.common.model.HttpRequestBuilder;
import org.apache.http.protocol.HttpService;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpResponseException;
import com.google.common.collect.Collections2;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
Expand All @@ -37,7 +36,6 @@
import java.io.InputStream;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,31 +203,34 @@ void execute_shouldNotUseErrorDataOnHttpError() throws IOException {
@ParameterizedTest(name = "Executing test case: {0}")
@MethodSource("successCases")
void execute_shouldContainCustomHeaders(final String input)
throws IOException, InstantiationException, IllegalAccessException {
throws IOException, InstantiationException, IllegalAccessException {
// given - minimal required entity
final var context =
OutboundConnectorContextBuilder.create().variables(input).secrets(name -> "foo").build();
HttpHeaders headers = HTTPService.extractRequestHeaders(
OutboundConnectorContextBuilder.create().variables(input).secrets(name -> "foo").build();
HttpHeaders headers =
HTTPService.extractRequestHeaders(
gson.fromJson(
gson.fromJson(input, JsonObject.class).get("graphql").toString(),
GraphQLRequest.class));
gson.fromJson(input, JsonObject.class).get("graphql").toString(),
GraphQLRequest.class));

when(requestFactory.buildRequest(
anyString(), any(GenericUrl.class), nullable(HttpContent.class)))
.thenReturn(httpRequest);
.thenReturn(httpRequest);
when(httpResponse.getHeaders())
.thenReturn(new HttpHeaders().setContentType(APPLICATION_JSON.getMimeType()));
.thenReturn(new HttpHeaders().setContentType(APPLICATION_JSON.getMimeType()));
when(httpRequest.execute()).thenReturn(httpResponse);
// when
functionUnderTest.execute(context);
// then
verify(httpRequest).setHeaders(
argThat(httpHeaders ->
headers.entrySet()
.stream()
.allMatch(
entry -> httpHeaders.containsKey(entry.getKey()) &&
httpHeaders.containsValue(entry.getValue()))));
verify(httpRequest)
.setHeaders(
argThat(
httpHeaders ->
headers.entrySet().stream()
.allMatch(
entry ->
httpHeaders.containsKey(entry.getKey())
&& httpHeaders.containsValue(entry.getValue()))));
}

private static Stream<String> successCases() throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<properties>
<version.spring-zeebe>8.2.0</version.spring-zeebe>

<version.spring-boot>3.0.5</version.spring-boot>
<version.spring-boot>3.0.6</version.spring-boot>
<version.spring-cloud-gcp-starter-logging>4.1.4</version.spring-cloud-gcp-starter-logging>

<version.aws-java-sdk>1.12.452</version.aws-java-sdk>
Expand Down

0 comments on commit 136963b

Please sign in to comment.