Skip to content

Commit

Permalink
[test] Make it obvious that the test fails with UnsupportedMessageTyp…
Browse files Browse the repository at this point in the history
…eException (#2763)

Related to #2754
  • Loading branch information
violetagg committed Apr 4, 2023
1 parent 77621ce commit a9fe467
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2021 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2017-2023 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,6 +41,7 @@
import io.netty.channel.FileRegion;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.MessageToMessageEncoder;
import io.netty.handler.codec.UnsupportedMessageTypeException;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.SslHandler;
Expand Down Expand Up @@ -244,6 +245,8 @@ public NettyOutbound withConnection(Consumer<? super Connection> withConnection)
.endsWith("End of File");

assertThat(f.isSuccess()).isFalse();
assertThat(f.cause()).isNotNull()
.isInstanceOf(UnsupportedMessageTypeException.class);
assertThat(channel.finishAndReleaseAll()).isTrue();
}

Expand Down

0 comments on commit a9fe467

Please sign in to comment.