-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support end-to-end idempotency for process state replication (#…
…3777) * feat: support end-to-end idempotency for process state replication * PR remarks
- Loading branch information
Showing
36 changed files
with
784 additions
and
383 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
core/common/boot/src/test/java/org/eclipse/edc/spi/entity/ProtocolMessagesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.spi.entity; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.eclipse.edc.spi.types.TypeManager; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class ProtocolMessagesTest { | ||
|
||
private final ObjectMapper mapper = new TypeManager().getMapper(); | ||
|
||
@Test | ||
void serdes() throws JsonProcessingException { | ||
var protocolMessages = new ProtocolMessages(); | ||
protocolMessages.addReceived("received"); | ||
protocolMessages.setLastSent("lastSent"); | ||
|
||
var json = mapper.writeValueAsString(protocolMessages); | ||
var deserialized = mapper.readValue(json, ProtocolMessages.class); | ||
|
||
assertThat(deserialized).usingRecursiveComparison().isEqualTo(protocolMessages); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.