ddanielr commented on code in PR #3915:
URL: https://github.com/apache/accumulo/pull/3915#discussion_r1401075570
##########
core/src/test/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlannerTest.java:
##########
@@ -302,6 +317,60 @@ public void testErrorExternalNoQueue() {
assertTrue(e.getMessage().contains("queue"), "Error message didn't contain
queue");
}
+ /**
+ * Tests queue with missing name throws error
+ */
+ @Test
+ public void testErrorQueueNoName() {
+ DefaultCompactionPlanner planner = new DefaultCompactionPlanner();
+ Configuration conf = EasyMock.createMock(Configuration.class);
+
EasyMock.expect(conf.isSet(EasyMock.anyString())).andReturn(false).anyTimes();
+
+ ServiceEnvironment senv = EasyMock.createMock(ServiceEnvironment.class);
+ EasyMock.expect(senv.getConfiguration()).andReturn(conf).anyTimes();
+ EasyMock.replay(conf, senv);
+
+ String queues =
+ "[{\"name\":\"smallQueue\", \"maxSize\":\"32M\"},
{\"type\":\"internal\", \"queue\":\"broken\"}]";
Review Comment:
I made the test more explicit and also added additional json parsing logic
so the code errors on additional fields instead of just silently ignoring them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]