// Path: summer-mqtt-core/src/main/java/com/github/christophersmith/summer/mqtt/core/MqttClientConnectionType.java
// public enum MqttClientConnectionType
// {
//         /**
//          * Represents a connection type that can only publish messages.
//          */
//         PUBLISHER,
//         /**
//          * Represents a connection type that can both publish and receive messages.
//          */
//         PUBSUB,
//         /**
//          * Represents a connection type can only receive messages.
//          */
//         SUBSCRIBER;
// }
// 
// Path: summer-mqtt-paho/src/test/java/com/github/christophersmith/summer/mqtt/paho/service/util/BrokerHelper.java
// public class BrokerHelper
// {
//     private static final String CLIENT_ID         = MqttAsyncClient.generateClientId();
//     private static final String BROKER_URI_FORMAT = "tcp://%s:%s";
//     private static final String BROKER_HOST_NAME = "mqtt.eclipse.org";
//     private static final int    BROKER_PORT       = 1883;
//     private static final String PROXY_HOST_NAME   = "localhost";
//     private static final int    PROXY_PORT        = 10080;
// 
//     public static String getClientId()
//     {
//         return CLIENT_ID;
//     }
// 
//     public static String getBrokerHostName()
//     {
//         return BROKER_HOST_NAME;
//     }
// 
//     public static int getBrokerPort()
//     {
//         return BROKER_PORT;
//     }
// 
//     public static String getBrokerUri()
//     {
//         return String.format(BROKER_URI_FORMAT, BROKER_HOST_NAME, String.valueOf(BROKER_PORT));
//     }
// 
//     public static String getProxyHostName()
//     {
//         return PROXY_HOST_NAME;
//     }
// 
//     public static int getProxyPort()
//     {
//         return PROXY_PORT;
//     }
// 
//     public static String getProxyUri()
//     {
//         return String.format(BROKER_URI_FORMAT, PROXY_HOST_NAME, String.valueOf(PROXY_PORT));
//     }
// }


import org.eclipse.paho.client.mqttv3.MqttException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import com.github.christophersmith.summer.mqtt.core.MqttClientConnectionType;
import com.github.christophersmith.summer.mqtt.paho.service.util.BrokerHelper;
/*******************************************************************************
 * Copyright (c) 2019 Christopher Smith - https://github.com/christophersmith
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package com.github.christophersmith.summer.mqtt.paho.service;



public class PahoAsyncMqttClientServiceTest
{
    private static final String VALUE_BLANK                  = "";
    private static final String EXCEPTION_MESSAGE_SERVER_URI = "'serverUri' must be set!";
    private static final String EXCEPTION_MESSAGE_CLIENT_ID  = "'clientId' must be set!";
    @Rule
    public ExpectedException    thrown                       = ExpectedException.none();

    @Test
    public void testConstructionBlankServerUri() throws MqttException
    {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(EXCEPTION_MESSAGE_SERVER_URI);
        new PahoAsyncMqttClientService(VALUE_BLANK, BrokerHelper.getClientId(),
// Path: summer-mqtt-core/src/main/java/com/github/christophersmith/summer/mqtt/core/MqttClientConnectionType.java
// public enum MqttClientConnectionType
// {
//         /**
//          * Represents a connection type that can only publish messages.
//          */
//         PUBLISHER,
//         /**
//          * Represents a connection type that can both publish and receive messages.
//          */
//         PUBSUB,
//         /**
//          * Represents a connection type can only receive messages.
//          */
//         SUBSCRIBER;
// }
// 
// Path: summer-mqtt-paho/src/test/java/com/github/christophersmith/summer/mqtt/paho/service/util/BrokerHelper.java
// public class BrokerHelper
// {
//     private static final String CLIENT_ID         = MqttAsyncClient.generateClientId();
//     private static final String BROKER_URI_FORMAT = "tcp://%s:%s";
//     private static final String BROKER_HOST_NAME = "mqtt.eclipse.org";
//     private static final int    BROKER_PORT       = 1883;
//     private static final String PROXY_HOST_NAME   = "localhost";
//     private static final int    PROXY_PORT        = 10080;
// 
//     public static String getClientId()
//     {
//         return CLIENT_ID;
//     }
// 
//     public static String getBrokerHostName()
//     {
//         return BROKER_HOST_NAME;
//     }
// 
//     public static int getBrokerPort()
//     {
//         return BROKER_PORT;
//     }
// 
//     public static String getBrokerUri()
//     {
//         return String.format(BROKER_URI_FORMAT, BROKER_HOST_NAME, String.valueOf(BROKER_PORT));
//     }
// 
//     public static String getProxyHostName()
//     {
//         return PROXY_HOST_NAME;
//     }
// 
//     public static int getProxyPort()
//     {
//         return PROXY_PORT;
//     }
// 
//     public static String getProxyUri()
//     {
//         return String.format(BROKER_URI_FORMAT, PROXY_HOST_NAME, String.valueOf(PROXY_PORT));
//     }
// }


// Path: summer-mqtt-paho/src/test/java/com/github/christophersmith/summer/mqtt/paho/service/PahoAsyncMqttClientServiceTest.java
import org.eclipse.paho.client.mqttv3.MqttException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import com.github.christophersmith.summer.mqtt.core.MqttClientConnectionType;
import com.github.christophersmith.summer.mqtt.paho.service.util.BrokerHelper;

/*******************************************************************************
 * Copyright (c) 2019 Christopher Smith - https://github.com/christophersmith
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package com.github.christophersmith.summer.mqtt.paho.service;



public class PahoAsyncMqttClientServiceTest
{
    private static final String VALUE_BLANK                  = "";
    private static final String EXCEPTION_MESSAGE_SERVER_URI = "'serverUri' must be set!";
    private static final String EXCEPTION_MESSAGE_CLIENT_ID  = "'clientId' must be set!";
    @Rule
    public ExpectedException    thrown                       = ExpectedException.none();

    @Test
    public void testConstructionBlankServerUri() throws MqttException
    {
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage(EXCEPTION_MESSAGE_SERVER_URI);
        new PahoAsyncMqttClientService(VALUE_BLANK, BrokerHelper.getClientId(),
            MqttClientConnectionType.PUBSUB, null);