Skip to content

Commit

Permalink
fix: make consumer use the consumer process id to handle a provider o…
Browse files Browse the repository at this point in the history
…ffer (#4528)

* Fixes use of incorrect process id

* Update dependencies
  • Loading branch information
jimmarino authored Oct 3, 2024
1 parent 9f33db9 commit d2b2f90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ maven/mavencentral/com.jcraft/jzlib/1.1.3, BSD-2-Clause, approved, CQ6218
maven/mavencentral/com.lmax/disruptor/3.4.4, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.networknt/json-schema-validator/1.0.76, Apache-2.0, approved, CQ22638
maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.28, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.41.2, , restricted, clearlydefined
maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.41.2, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.puppycrawl.tools/checkstyle/10.18.2, LGPL-2.1-or-later AND (Apache-2.0 AND LGPL-2.1-or-later) AND Apache-2.0, approved, #16060
maven/mavencentral/com.samskivert/jmustache/1.15, BSD-2-Clause AND BSD-3-Clause, approved, clearlydefined
maven/mavencentral/com.squareup.okhttp3/okhttp-dnsoverhttps/4.12.0, Apache-2.0, approved, #11159
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public ServiceResult<ContractNegotiation> notifyOffered(ContractOfferMessage mes
.compose(agent -> {
ServiceResult<ContractNegotiation> result = message.getConsumerPid() == null
? createNegotiation(message, agent.getIdentity(), CONSUMER, message.getCallbackAddress())
: getAndLeaseNegotiation(message.getProviderPid())
: getAndLeaseNegotiation(message.getConsumerPid())
.compose(negotiation -> validateRequest(agent, negotiation).map(it -> negotiation));

return result.onSuccess(negotiation -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ void shouldTransitionToOffered_whenNegotiationAlreadyExist() {
var updatedNegotiation = result.getContent();
assertThat(updatedNegotiation.getContractOffers()).hasSize(2);
assertThat(updatedNegotiation.getLastContractOffer()).isEqualTo(contractOffer);
verify(store).findByIdAndLease("providerPid");
verify(store).findByIdAndLease("consumerPid");
verify(listener).offered(any());
verify(transactionContext, atLeastOnce()).execute(any(TransactionContext.ResultTransactionBlock.class));
}
Expand Down

0 comments on commit d2b2f90

Please sign in to comment.