Skip to content

Commit

Permalink
Changed to non-null assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosbat committed Oct 6, 2024
1 parent 317c934 commit 42638f6
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import org.junit.jupiter.api.Test;
import org.springframework.util.SerializationUtils;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;

/**
* @author Dave Syer
Expand All @@ -34,10 +34,7 @@ void testSerialization() {
vet.setId(123);
@SuppressWarnings("deprecation")
Vet other = (Vet) SerializationUtils.deserialize(SerializationUtils.serialize(vet));
if (other == null) {
fail("other expected value but is null.");
return;
}
assertNotNull(other, "other expected value but is null.");
assertThat(other.getFirstName()).isEqualTo(vet.getFirstName());
assertThat(other.getLastName()).isEqualTo(vet.getLastName());
assertThat(other.getId()).isEqualTo(vet.getId());
Expand Down

0 comments on commit 42638f6

Please sign in to comment.