File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
main/java/org/hibernate/search/util/common/serialization/spi
test/java/org/hibernate/search/util/common/serialization/spi Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 10
10
import java .io .ObjectInputStream ;
11
11
import java .io .ObjectOutputStream ;
12
12
13
+ @ Deprecated (since = "8.1" , forRemoval = true )
13
14
public final class SerializationUtils {
14
15
15
16
private SerializationUtils () {
Original file line number Diff line number Diff line change
1
+ /*
2
+ * SPDX-License-Identifier: Apache-2.0
3
+ * Copyright Red Hat Inc. and Hibernate Authors
4
+ */
5
+ package org .hibernate .search .util .common .serialization .spi ;
6
+
7
+ import static org .assertj .core .api .Assertions .assertThat ;
8
+
9
+ import java .io .Serializable ;
10
+
11
+ import org .junit .jupiter .api .Test ;
12
+
13
+ class SerializationUtilsTest {
14
+
15
+ @ SuppressWarnings ("removal" )
16
+ @ Test
17
+ void smoke () {
18
+ MyRecord test = new MyRecord ( 1 , "smth" );
19
+ byte [] serialized = SerializationUtils .serialize ( test );
20
+
21
+ MyRecord deserialized = SerializationUtils .deserialize ( MyRecord .class , serialized );
22
+ assertThat ( deserialized ).isEqualTo ( test );
23
+ }
24
+
25
+ record MyRecord (int number , String string ) implements Serializable {
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments