broker/SubscriptionsStoreTest: code formatter used
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
*
|
*
|
||||||
* You may elect to redistribute this code under either of these licenses.
|
* You may elect to redistribute this code under either of these licenses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.moquette.spi.impl.subscriptions;
|
package io.moquette.spi.impl.subscriptions;
|
||||||
|
|
||||||
import io.moquette.spi.ClientSession;
|
import io.moquette.spi.ClientSession;
|
||||||
@@ -22,11 +23,9 @@ import io.moquette.spi.impl.MemoryStorageService;
|
|||||||
import io.netty.handler.codec.mqtt.MqttQoS;
|
import io.netty.handler.codec.mqtt.MqttQoS;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.*;
|
import static org.assertj.core.api.Assertions.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -146,7 +145,6 @@ public class SubscriptionsStoreTest {
|
|||||||
assertThat(store.matches("finance/stock/ibm")).containsExactlyInAnyOrder(financeAnySub, anySub);
|
assertThat(store.matches("finance/stock/ibm")).containsExactlyInAnyOrder(financeAnySub, anySub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMatchingDeepMulti_two_layer() {
|
public void testMatchingDeepMulti_two_layer() {
|
||||||
Subscription financeAnySub = new Subscription("FAKE_CLI_ID_1", "finance/stock/#", MqttQoS.AT_MOST_ONCE);
|
Subscription financeAnySub = new Subscription("FAKE_CLI_ID_1", "finance/stock/#", MqttQoS.AT_MOST_ONCE);
|
||||||
@@ -180,7 +178,6 @@ public class SubscriptionsStoreTest {
|
|||||||
assertThat(store.matches("/finance")).contains(manySub);
|
assertThat(store.matches("/finance")).contains(manySub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMatchSlashSingle() {
|
public void testMatchSlashSingle() {
|
||||||
Subscription slashPlusSub = new Subscription("FAKE_CLI_ID_1", "/+", MqttQoS.AT_MOST_ONCE);
|
Subscription slashPlusSub = new Subscription("FAKE_CLI_ID_1", "/+", MqttQoS.AT_MOST_ONCE);
|
||||||
@@ -195,7 +192,6 @@ public class SubscriptionsStoreTest {
|
|||||||
assertThat(store.matches("/finance")).doesNotContain(anySub);
|
assertThat(store.matches("/finance")).doesNotContain(anySub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMatchManyDeepSingle() {
|
public void testMatchManyDeepSingle() {
|
||||||
Subscription slashPlusSub = new Subscription("FAKE_CLI_ID_1", "/finance/+/ibm", MqttQoS.AT_MOST_ONCE);
|
Subscription slashPlusSub = new Subscription("FAKE_CLI_ID_1", "/finance/+/ibm", MqttQoS.AT_MOST_ONCE);
|
||||||
@@ -275,7 +271,6 @@ public class SubscriptionsStoreTest {
|
|||||||
assertThat(store.matches(topic)).isEmpty();
|
assertThat(store.matches(topic)).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRemoveClientSubscriptions_existingClientID() {
|
public void testRemoveClientSubscriptions_existingClientID() {
|
||||||
String cliendID = "FAKE_CLID_1";
|
String cliendID = "FAKE_CLID_1";
|
||||||
@@ -331,7 +326,6 @@ public class SubscriptionsStoreTest {
|
|||||||
assertThat(SubscriptionsStore.matchTopics("finance/stock/ibm", "finance/#")).isTrue();
|
assertThat(SubscriptionsStore.matchTopics("finance/stock/ibm", "finance/#")).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMatchTopics_single() {
|
public void testMatchTopics_single() {
|
||||||
assertThat(SubscriptionsStore.matchTopics("finance", "+")).isTrue();
|
assertThat(SubscriptionsStore.matchTopics("finance", "+")).isTrue();
|
||||||
@@ -396,8 +390,8 @@ public class SubscriptionsStoreTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Test for Issue #49
|
* Test for Issue #49
|
||||||
* */
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void duplicatedSubscriptionsWithDifferentQos() {
|
public void duplicatedSubscriptionsWithDifferentQos() {
|
||||||
ClientSession session2 = sessionsStore.createNewSession("client2", true);
|
ClientSession session2 = sessionsStore.createNewSession("client2", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user