Fixed MqttChannelInitializerSslTest
@@ -26,7 +26,6 @@ import com.hivemq.client.internal.mqtt.handler.connect.MqttConnectHandler;
import com.hivemq.client.internal.mqtt.handler.disconnect.MqttDisconnectHandler;
import com.hivemq.client.internal.mqtt.handler.websocket.MqttWebSocketInitializer;
import com.hivemq.client.internal.mqtt.message.connect.MqttConnect;
-import com.hivemq.client.mqtt.MqttVersion;
import dagger.Lazy;
import io.netty.channel.Channel;
import io.netty.channel.embedded.EmbeddedChannel;
@@ -36,8 +35,6 @@ import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import java.util.Optional;
-
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -71,15 +68,13 @@ public class MqttChannelInitializerSslTest {
public void before() {
MockitoAnnotations.initMocks(this);
channel = new EmbeddedChannel();
- when(clientData.getSslConfig()).thenReturn(Optional.empty());
}
@Test
public void test_initialize_default_ssldata() throws Exception {
- when(clientData.getMqttVersion()).thenReturn(MqttVersion.MQTT_5_0);
final MqttClientTransportConfigImpl transportConfig = mock(MqttClientTransportConfigImpl.class);
final MqttClientSslConfigImpl sslConfig = mock(MqttClientSslConfigImpl.class);
- when(clientData.getTransportConfig()).thenReturn(transportConfig);
+ when(connAckFlow.getTransportConfig()).thenReturn(transportConfig);
when(transportConfig.getRawSslConfig()).thenReturn(sslConfig);
final MqttChannelInitializer mqttChannelInitializer =
