use of org.apache.qpid.server.management.plugin.RequestType in project qpid-broker-j by apache.
the class LatestManagementControllerTest method getRequestTypeForGetAndUserPreferences.
@Test
public void getRequestTypeForGetAndUserPreferences() throws Exception {
final String hostName = "test";
final QueueManagingVirtualHost<?> virtualHost = createVirtualHostWithQueue(hostName, "foo", "bar");
final ManagementRequest request = mock(ManagementRequest.class);
when(request.getCategory()).thenReturn("queue");
doReturn(virtualHost.getBroker()).when(request).getRoot();
List<String> path = Arrays.asList(virtualHost.getParent().getName(), hostName, "bar", "userpreferences");
when(request.getPath()).thenReturn(path);
when(request.getParameters()).thenReturn(Collections.emptyMap());
when(request.getMethod()).thenReturn("GET");
final RequestType type = _controller.getRequestType(request);
assertThat(type, is(equalTo(RequestType.USER_PREFERENCES)));
}
Aggregations