@Test
public void testInvokeOperation() throws Exception {

    String operationName = "operation_name";
    expect(mockSanitizer.urlDecode(operationName, ENCODING)).andReturn(operationName);
    MBeanOperationInfo mockOperation = createMock(MBeanOperationInfo.class);
    MBeanOperationInfo[] operationList = new MBeanOperationInfo[1];
    operationList[0] = mockOperation;
    expect(mockMBeanInfo.getOperations()).andReturn(operationList);
    expect(mockOperation.getName()).andReturn(operationName);
    Map<String, String[]> parameterMap = new HashMap<String, String[]>();
    Object value = new Object();
    expect(mockMBeanOperationInvoker.invokeOperation(parameterMap)).andReturn(value);
    String valueString = "some_value";
    expect(mockSanitizer.escapeValue(value)).andReturn(valueString);
    replay(mockMBeanServer, mockSanitizer, mockObjectName, mockMBeanInfo, mockOperation, mockMBeanOperationInvoker);
    String invokeResult = webMBeanAdapter.invokeOperation(operationName, parameterMap);
    assertEquals(valueString, invokeResult);
    verify(mockMBeanServer, mockSanitizer, mockObjectName, mockMBeanInfo, mockOperation, mockMBeanOperationInvoker);
}