Class HivemqV5MessageBinderTest
- java.lang.Object
-
- test.de.iip_ecosphere.platform.transport.spring.binder.hivemqv5.HivemqV5MessageBinderTest
-
- Direct Known Subclasses:
HivemqV5MessageBinderTlsTest
@SpringBootTest @TestPropertySource(locations="classpath:test.properties") @ContextConfiguration(initializers=Initializer.class) public class HivemqV5MessageBinderTest extends Object
Test class for the message binder. This class uses the application configuration from transport.spring! Binder name is explicitly configured intest.propertiesasspring.cloud.stream.defaultBinderin order to test for a correct binder name.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHivemqV5MessageBinderTest.InitializerAn initializer to override certain configuration values, in particular dynamic ports.static classHivemqV5MessageBinderTest.MyProcessorA simple test processor.
-
Field Summary
Fields Modifier and Type Field Description private static de.iip_ecosphere.platform.support.ServerAddressaddrprivate de.iip_ecosphere.platform.transport.connectors.TransportParameterparamsprivate static Stringreceivedprivate static FilesecCfgprivate static test.de.iip_ecosphere.platform.test.mqtt.hivemq.TestHiveMqServerserver
-
Constructor Summary
Constructors Constructor Description HivemqV5MessageBinderTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static FilegetKeystore()Returns the keystore ifsecCfgis set.protected static StringgetKeystorePassword()Returns the keystore password ifsecCfgis set.static voidinit()Initializes the test by starting an embedded MQTT server and by sending back received results on the output stream to the "input2" stream.protected static de.iip_ecosphere.platform.support.ServerAddressresetAddr(de.iip_ecosphere.platform.support.Schema schema)Rests the broker address.protected static voidsetSecCfg(File folder)Defines the secure config folder.static voidshutdown()Shuts down client and test server.voidtestMessages()Testing.
-
-
-
Field Detail
-
addr
private static de.iip_ecosphere.platform.support.ServerAddress addr
-
server
private static test.de.iip_ecosphere.platform.test.mqtt.hivemq.TestHiveMqServer server
-
received
private static String received
-
secCfg
private static File secCfg
-
params
@Autowired private de.iip_ecosphere.platform.transport.connectors.TransportParameter params
-
-
Method Detail
-
setSecCfg
protected static void setSecCfg(File folder)
Defines the secure config folder.- Parameters:
folder- the folder, used instead of the default config folder if not null
-
getKeystore
protected static File getKeystore()
Returns the keystore ifsecCfgis set.- Returns:
- the keystore, null if
secCfgis null
-
getKeystorePassword
protected static String getKeystorePassword()
Returns the keystore password ifsecCfgis set.- Returns:
- the keystore password, null if
secCfgis null
-
resetAddr
protected static de.iip_ecosphere.platform.support.ServerAddress resetAddr(de.iip_ecosphere.platform.support.Schema schema)
Rests the broker address.- Parameters:
schema- the address schema- Returns:
- the new broker address
-
init
public static void init()
Initializes the test by starting an embedded MQTT server and by sending back received results on the output stream to the "input2" stream. Requires the application configuration file "test.properties" in the test classpath as well as the HiveMq configuration xml/extensions folder in src/test.
-
shutdown
public static void shutdown()
Shuts down client and test server.
-
testMessages
public void testMessages()
Testing.
-
-