Polish contribution

See gh-28075
This commit is contained in:
Sam Brannen
2022-03-29 13:39:40 +02:00
parent 7f7fb58dd0
commit c8d0146bcc
3 changed files with 32 additions and 17 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,32 +38,36 @@ class SerializationUtilsTests {
@Test
void serializeCycleSunnyDay() throws Exception {
@SuppressWarnings("deprecation")
void serializeCycleSunnyDay() {
assertThat(SerializationUtils.deserialize(SerializationUtils.serialize("foo"))).isEqualTo("foo");
}
@Test
void deserializeUndefined() throws Exception {
@SuppressWarnings("deprecation")
void deserializeUndefined() {
assertThatIllegalStateException().isThrownBy(() -> SerializationUtils.deserialize(FOO.toByteArray()));
}
@Test
void serializeNonSerializable() throws Exception {
void serializeNonSerializable() {
assertThatIllegalArgumentException().isThrownBy(() -> SerializationUtils.serialize(new Object()));
}
@Test
void deserializeNonSerializable() throws Exception {
@SuppressWarnings("deprecation")
void deserializeNonSerializable() {
assertThatIllegalArgumentException().isThrownBy(() -> SerializationUtils.deserialize("foo".getBytes()));
}
@Test
void serializeNull() throws Exception {
void serializeNull() {
assertThat(SerializationUtils.serialize(null)).isNull();
}
@Test
void deserializeNull() throws Exception {
@SuppressWarnings("deprecation")
void deserializeNull() {
assertThat(SerializationUtils.deserialize(null)).isNull();
}
@@ -72,4 +76,5 @@ class SerializationUtilsTests {
IllegalArgumentException ex = new IllegalArgumentException("foo");
assertThat(SerializationUtils.clone(ex)).hasMessage("foo").isNotSameAs(ex);
}
}