Skip to content

Commit

Permalink
Make ProjectId serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhorridge committed May 13, 2024
1 parent c32f1f9 commit 65ccd51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import com.fasterxml.jackson.annotation.JsonValue;

import javax.annotation.Nonnull;
import java.io.Serializable;
import java.util.UUID;

public record ProjectId(@Nonnull String id) implements ValueObject {
public record ProjectId(@Nonnull String id) implements ValueObject, Serializable {

@JsonCreator
@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import org.junit.jupiter.api.Test;

import java.io.Serializable;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertThrows;

Expand All @@ -12,6 +15,10 @@
*/
public class ProjectId_Tests {

@Test
void shouldBeSerializable() {
assertThat(ProjectId.class).isAssignableTo(Serializable.class);
}

@Test
public void equalsShouldReturnTrueForObjectsWithSameId() {
Expand Down

0 comments on commit 65ccd51

Please sign in to comment.