Minor change, removed unusefull ParseExeptions logging
This commit is contained in:
+2
-6
@@ -48,12 +48,8 @@ class AuthorizationsCollector implements IAuthorizator {
|
|||||||
return coll;
|
return coll;
|
||||||
}
|
}
|
||||||
|
|
||||||
void parse(String line) {
|
void parse(String line) throws ParseException {
|
||||||
try {
|
m_authorizations.add(parseAuthLine(line));
|
||||||
m_authorizations.add(parseAuthLine(line));
|
|
||||||
} catch (ParseException pex) {
|
|
||||||
LOG.warn(String.format("Error parsing ACL definition [%s]", line), pex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static Authorization parseAuthLine(String line) throws ParseException {
|
protected static Authorization parseAuthLine(String line) throws ParseException {
|
||||||
|
|||||||
+5
-8
@@ -20,9 +20,6 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
|
||||||
import static java.util.Arrays.asList;
|
|
||||||
import static org.eclipse.moquette.spi.impl.security.Authorization.Permission.READ;
|
|
||||||
import static org.eclipse.moquette.spi.impl.security.Authorization.Permission.WRITE;
|
|
||||||
import static org.eclipse.moquette.spi.impl.security.AuthorizationsCollector.*;
|
import static org.eclipse.moquette.spi.impl.security.AuthorizationsCollector.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
@@ -90,7 +87,7 @@ public class AuthorizationsCollectorTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCanWriteSimpleTopic() {
|
public void testCanWriteSimpleTopic() throws ParseException {
|
||||||
authorizator.parse("topic write /sensors");
|
authorizator.parse("topic write /sensors");
|
||||||
|
|
||||||
//verify
|
//verify
|
||||||
@@ -98,7 +95,7 @@ public class AuthorizationsCollectorTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCanReadSimpleTopic() {
|
public void testCanReadSimpleTopic() throws ParseException {
|
||||||
authorizator.parse("topic read /sensors");
|
authorizator.parse("topic read /sensors");
|
||||||
|
|
||||||
//verify
|
//verify
|
||||||
@@ -106,7 +103,7 @@ public class AuthorizationsCollectorTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCanReadWriteMixedSimpleTopic() {
|
public void testCanReadWriteMixedSimpleTopic() throws ParseException {
|
||||||
authorizator.parse("topic write /sensors");
|
authorizator.parse("topic write /sensors");
|
||||||
authorizator.parse("topic read /sensors/anemometer");
|
authorizator.parse("topic read /sensors/anemometer");
|
||||||
|
|
||||||
@@ -116,7 +113,7 @@ public class AuthorizationsCollectorTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCanWriteMultiMatherTopic() {
|
public void testCanWriteMultiMatherTopic() throws ParseException {
|
||||||
authorizator.parse("topic write /sensors/#");
|
authorizator.parse("topic write /sensors/#");
|
||||||
|
|
||||||
//verify
|
//verify
|
||||||
@@ -124,7 +121,7 @@ public class AuthorizationsCollectorTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCanWriteSingleMatherTopic() {
|
public void testCanWriteSingleMatherTopic() throws ParseException {
|
||||||
authorizator.parse("topic write /sensors/+");
|
authorizator.parse("topic write /sensors/+");
|
||||||
|
|
||||||
//verify
|
//verify
|
||||||
|
|||||||
Reference in New Issue
Block a user