public void testFetchCapabilities() throws Exception {
when(connection.get(TEST_CAPABILITIES_ENDPOINT)).thenReturn(CAPABILITIES_XML);
RobotAccountData accountData = connector.fetchCapabilities(ROBOT_ACCOUNT, "");
RobotCapabilities capabilities = accountData.getCapabilities();
assertEquals("Expected capabilities hash as specified in the xml", CAPABILITIES_HASH,
capabilities.getCapabilitiesHash());
assertEquals("Expected protocol version as specified in the xml", ProtocolVersion.V2_2,
capabilities.getProtocolVersion());
Map<EventType, Capability> capabilitiesMap = capabilities.getCapabilitiesMap();
assertTrue("Expected capabilities as specified in the xml", capabilitiesMap.size() == 2);
assertTrue("Expected capabilities as specified in the xml",
capabilitiesMap.containsKey(EventType.WAVELET_SELF_ADDED));
assertTrue("Expected capabilities as specified in the xml",
capabilitiesMap.containsKey(EventType.OPERATION_ERROR));