mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Polish contribution
See gh-28075
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user