Util.checkIsValidProxyForId(proxyForId); OperationQueue opQueue = new OperationQueue(proxyForId); opQueue.fetchWavelet(waveId, waveletId);
public void testProxyFor() throws Exception { OperationQueue queue = new OperationQueue(); queue.createWavelet("google.com", Collections.<String>emptySet()); OperationQueue proxyingForQueue = queue.proxyFor("foo"); assertEquals(1, proxyingForQueue.getPendingOperations().size()); proxyingForQueue.setTitleOfWavelet(wavelet, "My title"); List<OperationRequest> ops = proxyingForQueue.getPendingOperations(); assertEquals(2, ops.size()); assertEquals(OperationType.ROBOT_CREATE_WAVELET.method(), ops.get(0).getMethod()); assertNull(ops.get(0).getParameter(ParamsProperty.PROXYING_FOR)); assertEquals(OperationType.WAVELET_SET_TITLE.method(), ops.get(1).getMethod()); assertEquals("foo", ops.get(1).getParameter(ParamsProperty.PROXYING_FOR)); OperationQueue nonProxyingForQueue = proxyingForQueue.proxyFor(null); nonProxyingForQueue.fetchWavelet(WaveId.of("example.com", "wave2"), WaveletId.of("example.com", "wavelet2")); ops = nonProxyingForQueue.getPendingOperations(); assertEquals(3, ops.size()); assertNull(ops.get(2).getParameter(ParamsProperty.PROXYING_FOR)); }
public void testProxyFor() throws Exception { OperationQueue queue = new OperationQueue(); queue.createWavelet("google.com", Collections.<String>emptySet()); OperationQueue proxyingForQueue = queue.proxyFor("foo"); assertEquals(1, proxyingForQueue.getPendingOperations().size()); proxyingForQueue.setTitleOfWavelet(wavelet, "My title"); List<OperationRequest> ops = proxyingForQueue.getPendingOperations(); assertEquals(2, ops.size()); assertEquals(OperationType.ROBOT_CREATE_WAVELET.method(), ops.get(0).getMethod()); assertNull(ops.get(0).getParameter(ParamsProperty.PROXYING_FOR)); assertEquals(OperationType.WAVELET_SET_TITLE.method(), ops.get(1).getMethod()); assertEquals("foo", ops.get(1).getParameter(ParamsProperty.PROXYING_FOR)); OperationQueue nonProxyingForQueue = proxyingForQueue.proxyFor(null); nonProxyingForQueue.fetchWavelet(WaveId.of("example.com", "wave2"), WaveletId.of("example.com", "wavelet2")); ops = nonProxyingForQueue.getPendingOperations(); assertEquals(3, ops.size()); assertNull(ops.get(2).getParameter(ParamsProperty.PROXYING_FOR)); }