@Test
public void searchRequest() {

    for (JmxSearchRequest req : new JmxSearchRequest[] {
            (JmxSearchRequest) JmxRequestFactory.createGetRequest("search/java.lang:*", procParams),
            (JmxSearchRequest) JmxRequestFactory.createPostRequest(
                    createMap("type", "search", "mbean", "java.lang:*"),procParams)
    }) {
        assertEquals(req.getType(),RequestType.SEARCH);
        assertEquals(req.getObjectName().getCanonicalName(),"java.lang:*");
        assertTrue(req.getObjectName().isPattern());
        verify(req,"type","search");
        verify(req,"mbean","java.lang:*");
    }
}