From 7b57f04db9fc96c5235e29670e56ecb375fdd1a1 Mon Sep 17 00:00:00 2001 From: Andreas Mager Date: Wed, 1 Feb 2017 16:12:53 +0100 Subject: [PATCH] broker/test/ServerIntegrationDBAuthenticatorTest: code formatter used --- .../ServerIntegrationDBAuthenticatorTest.java | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/broker/src/test/java/io/moquette/server/ServerIntegrationDBAuthenticatorTest.java b/broker/src/test/java/io/moquette/server/ServerIntegrationDBAuthenticatorTest.java index d27ebb33..1e23b545 100644 --- a/broker/src/test/java/io/moquette/server/ServerIntegrationDBAuthenticatorTest.java +++ b/broker/src/test/java/io/moquette/server/ServerIntegrationDBAuthenticatorTest.java @@ -1,3 +1,4 @@ + package io.moquette.server; import io.moquette.BrokerConstants; @@ -10,19 +11,18 @@ import org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence; import org.junit.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import java.io.File; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import java.util.Properties; - import static org.junit.Assert.assertTrue; /** * Created by mackristof on 13/05/2016. */ public class ServerIntegrationDBAuthenticatorTest { + private static final Logger LOG = LoggerFactory.getLogger(ServerIntegrationDBAuthenticatorTest.class); static MqttClientPersistence s_dataStore; @@ -35,8 +35,6 @@ public class ServerIntegrationDBAuthenticatorTest { MessageCollector m_messagesCollector; IConfig m_config; - - @BeforeClass public static void beforeTests() throws NoSuchAlgorithmException, SQLException, ClassNotFoundException { String tmpDir = System.getProperty("java.io.tmpdir"); @@ -53,7 +51,6 @@ public class ServerIntegrationDBAuthenticatorTest { m_server.startServer(m_config); } - private void stopServer() { m_server.stopServer(); IntegrationUtils.cleanPersistenceFile(m_config); @@ -96,7 +93,7 @@ public class ServerIntegrationDBAuthenticatorTest { } @AfterClass - public static void shutdown(){ + public static void shutdown() { dbAuthenticatorTest.teardown(); } @@ -111,9 +108,8 @@ public class ServerIntegrationDBAuthenticatorTest { assertTrue(true); } - @Test - public void connectWithWrongCredentials() { + public void connectWithWrongCredentials() { LOG.info("*** connectWithWrongCredentials ***"); try { m_client = new MqttClient("tcp://localhost:1883", "Publisher", s_pubDataStore); @@ -121,18 +117,16 @@ public class ServerIntegrationDBAuthenticatorTest { options.setUserName("dbuser"); options.setPassword("wrongPassword".toCharArray()); m_client.connect(options); - } catch (MqttException e){ + } catch (MqttException e) { if (e instanceof MqttSecurityException) { assertTrue(true); return; } else { - assertTrue(e.getMessage(),false); + assertTrue(e.getMessage(), false); return; } } - assertTrue("must not be connected. cause : wrong password given to client",false); - + assertTrue("must not be connected. cause : wrong password given to client", false); } - }