File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
it/java/software/amazon/smithy/java/codegen/test
main/java/software/amazon/smithy/java/codegen/generators Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 2626import software .amazon .smithy .java .codegen .test .model .NestedUnion ;
2727import software .amazon .smithy .java .codegen .test .model .UnionType ;
2828import software .amazon .smithy .java .core .schema .SerializableShape ;
29- import software .amazon .smithy .java .core .serde .SerializationException ;
3029import software .amazon .smithy .java .core .serde .ShapeSerializer ;
3130import software .amazon .smithy .java .core .serde .document .Document ;
3231import software .amazon .smithy .model .shapes .ShapeType ;
@@ -112,6 +111,6 @@ void unknownUnionDeser() {
112111 @ Test
113112 void unknownUnionSerFails () {
114113 var union = UnionType .builder ().$unknownMember ("foo" ).build ();
115- assertThrows (SerializationException .class , () -> Document .of (union ));
114+ assertThrows (UnsupportedOperationException .class , () -> Document .of (union ));
116115 }
117116}
Original file line number Diff line number Diff line change 2020import software .amazon .smithy .java .core .schema .Schema ;
2121import software .amazon .smithy .java .core .schema .SchemaUtils ;
2222import software .amazon .smithy .java .core .schema .SerializableStruct ;
23- import software .amazon .smithy .java .core .serde .SerializationException ;
2423import software .amazon .smithy .java .core .serde .ShapeSerializer ;
2524import software .amazon .smithy .java .core .serde .document .Document ;
2625import software .amazon .smithy .model .Model ;
@@ -217,7 +216,7 @@ public static final class $$UnknownMember extends ${shape:T} {
217216
218217 @Override
219218 public void serialize(${shapeSerializer:T} serializer) {
220- throw new ${serdeException :T}("Cannot serialize union with unknown member " + this.memberName);
219+ throw new ${unsupportedOperation :T}("Cannot serialize union with unknown member " + this.memberName);
221220 }
222221
223222 @Override
@@ -230,7 +229,7 @@ public <T> T getValue() {
230229 }
231230 }
232231 """ ;
233- writer .putContext ("serdeException " , SerializationException .class );
232+ writer .putContext ("unsupportedOperation " , UnsupportedOperationException .class );
234233 writer .putContext ("string" , String .class );
235234 writer .write (template );
236235 writer .popState ();
You can’t perform that action at this time.
0 commit comments