summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins/management-http/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/broker-plugins/management-http/src/test')
-rw-r--r--qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverterTest.java13
1 files changed, 2 insertions, 11 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverterTest.java b/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverterTest.java
index 8e5c5e1c10..0c2b6a5385 100644
--- a/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverterTest.java
+++ b/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverterTest.java
@@ -25,6 +25,7 @@ import static org.apache.qpid.server.management.plugin.servlet.rest.ConfiguredOb
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -32,7 +33,6 @@ import junit.framework.TestCase;
import org.apache.qpid.server.model.ConfiguredObject;
import org.apache.qpid.server.model.Model;
-import org.apache.qpid.server.model.Statistics;
public class ConfiguredObjectToMapConverterTest extends TestCase
{
@@ -50,8 +50,7 @@ public class ConfiguredObjectToMapConverterTest extends TestCase
final String statisticName = "statisticName";
final int statisticValue = 10;
- Statistics mockStatistics = createMockStatistics(statisticName, statisticValue);
- when(_configuredObject.getStatistics()).thenReturn(mockStatistics);
+ when(_configuredObject.getStatistics()).thenReturn(Collections.singletonMap(statisticName, (Number) statisticValue));
Map<String, Object> resultMap = _converter.convertObjectToMap(_configuredObject, ConfiguredObject.class, 0);
Map<String, Object> statsAsMap = (Map<String, Object>) resultMap.get(STATISTICS_MAP_KEY);
@@ -127,14 +126,6 @@ public class ConfiguredObjectToMapConverterTest extends TestCase
when(mockConfiguredObject.getAttribute(attributeName)).thenReturn(attributeValue);
}
- private Statistics createMockStatistics(String statName, int statValue)
- {
- Statistics mockStatistics = mock(Statistics.class);
- when(mockStatistics.getStatisticNames()).thenReturn(Arrays.asList(statName));
- when(mockStatistics.getStatistic(statName)).thenReturn(statValue);
- return mockStatistics;
- }
-
private static interface TestChild extends ConfiguredObject
{
}