Skip to content

Commit

Permalink
chore(spring-zeebe) bump version of spring zeebe to 8.5.7 (#2815)
Browse files Browse the repository at this point in the history
* chore(spring-zeebe) bump version of spring zeebe to 8.5.7

* chore(spring-zeebe) bump version of spring zeebe to 8.5.7 (necessary changes in the code had to be made)

---------

Co-authored-by: Simon <[email protected]>
  • Loading branch information
mathias-vandaele and sbuettner authored Jul 8, 2024
1 parent 9344267 commit c29e947
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Map<String, String> getSecrets() {
try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) {
var request = new HttpGet(secretsEndpoint);
var authHeader = authentication.getTokenHeader(Product.CONSOLE);
request.addHeader(authHeader.getKey(), authHeader.getValue());
authHeader.forEach(request::addHeader);
return httpClient.execute(request, this::handleSecretsResponse);
} catch (Exception e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,15 @@ public class ConsoleSecretProviderTest {

static Authentication auth;

static Map.Entry<String, String> authToken;
static Map<String, String> authToken;

static ConsoleSecretApiClient client;

@BeforeAll
static void beforeAll() {
// Mock authentication
auth = Mockito.mock(Authentication.class);
authToken =
Collections.singletonMap("Authorization", "Bearer XXX").entrySet().iterator().next();
authToken = Map.of("Authorization", "Bearer XXX");
when(auth.getTokenHeader(Product.CONSOLE)).thenReturn(authToken);

client = new ConsoleSecretApiClient(wm.baseUrl() + "/secrets", auth);
Expand All @@ -65,7 +64,7 @@ void testSuccessfulSecretsHandling() {
var secretsResponse = Collections.singletonMap("secretKey", "secretValue");
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching("Bearer XXX"))
.willReturn(ResponseDefinitionBuilder.okForJson(secretsResponse)));

// Test the client
Expand All @@ -82,7 +81,7 @@ void testFailureOnInitialLoad() {
// Mock failing response
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching("Bearer XXX"))
.willReturn(ResponseDefinitionBuilder.responseDefinition().withStatus(500)));

// Test the client
Expand All @@ -95,7 +94,7 @@ void testSuccessfulSecretResolvingInCaseOfFailure() throws InterruptedException
var secretsResponse = Collections.singletonMap("secretKey", "secretValue");
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching("Bearer XXX"))
.willReturn(ResponseDefinitionBuilder.okForJson(secretsResponse)));

var consoleSecretProvider = new ConsoleSecretProvider(client, Duration.ofMillis(1));
Expand All @@ -107,7 +106,7 @@ void testSuccessfulSecretResolvingInCaseOfFailure() throws InterruptedException
// Mock failing response
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching("Bearer XXX"))
.willReturn(ResponseDefinitionBuilder.responseDefinition().withStatus(500)));

// Previously cached secret should still be resolved
Expand All @@ -120,7 +119,7 @@ void testSuccessfulSecretResolvingInCaseOfFailure() throws InterruptedException
secretsResponse = Collections.singletonMap("secretKey", "newSecretValue");
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching("Bearer XXX"))
.willReturn(ResponseDefinitionBuilder.okForJson(secretsResponse)));

// New secrets should be resolved
Expand Down
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ limitations under the License.</license.inlineheader>
<!-- Camunda internal libraries -->
<version.zeebe>8.5.3</version.zeebe>
<version.feel-engine>1.18.0-alpha1</version.feel-engine>
<version.spring-zeebe>8.5.5</version.spring-zeebe>
<version.spring-zeebe>8.5.7</version.spring-zeebe>

<!-- Third party dependencies -->

Expand Down

0 comments on commit c29e947

Please sign in to comment.