@Test
public void testGetOperationMetadata() throws Exception {

    String operationName1 = "operation_name_1";
    MBeanOperationInfo mockOperation1 = createMock(MBeanOperationInfo.class);
    String operationName2 = "operation_name_2";
    MBeanOperationInfo mockOperation2 = createMock(MBeanOperationInfo.class);
    MBeanOperationInfo[] operationList = new MBeanOperationInfo[2];
    operationList[0] = mockOperation1;
    operationList[1] = mockOperation2;
    expect(mockMBeanInfo.getOperations()).andReturn(operationList);
    expect(mockOperation1.getName()).andReturn(operationName1);
    expect(mockOperation2.getName()).andReturn(operationName2);
    replay(mockMBeanServer, mockSanitizer, mockObjectName, mockMBeanInfo,
            mockOperation1, mockOperation2);
    Map<String, MBeanOperationInfo> operationMap = webMBeanAdapter.getOperationMetadata();
    assertEquals(2, operationMap.size());
    assertEquals(mockOperation1, operationMap.get(operationName1));
    assertEquals(mockOperation2, operationMap.get(operationName2));
    verify(mockMBeanServer, mockSanitizer, mockObjectName, mockMBeanInfo,
            mockOperation1, mockOperation2);
}