public void testParseRequestSpecificData_syncStops() { ProtoBufAddressProxy mockProxy = PowerMock.createPartialMock(ProtoBufAddressProxy.class, "parseSyncStops"); ProtocolBuffer protocolBuffer = new ProtocolBuffer(); protocolBuffer.setBufferData(synStops_resp); protocolBuffer.setObjType(IServerProxyConstants.ACT_SYNC_STOPS); try { PowerMock.expectPrivate( mockProxy, "parseSyncStops", EasyMock.anyObject(ProtoCacheCitiesResp.class)); } catch (Exception e1) { fail(e1.toString()); } EasyMock.expectLastCall().once(); PowerMock.replay(mockProxy); try { mockProxy.parseRequestSpecificData(protocolBuffer); } catch (IOException e) { fail(e.toString()); } PowerMock.verify(mockProxy); }
public void testParseRequestSpecificData_fetchAllStops() { ProtoBufAddressProxy mockProxy = PowerMock.createPartialMock(ProtoBufAddressProxy.class, "parseFetchAllInThread"); ProtocolBuffer protocolBuffer = new ProtocolBuffer(); protocolBuffer.setBufferData(fetchAllStops_resp); protocolBuffer.setObjType(IServerProxyConstants.ACT_FETCH_ALL_STOPS); Whitebox.setInternalState(mockProxy, "isParseFetchAllInThread", true); try { PowerMock.expectPrivate( mockProxy, "parseFetchAllInThread", EasyMock.anyObject(ProtoCacheCitiesResp.class)); } catch (Exception e1) { fail(e1.toString()); } EasyMock.expectLastCall().once(); PowerMock.replay(mockProxy); try { mockProxy.parseRequestSpecificData(protocolBuffer); } catch (IOException e) { fail(e.toString()); } PowerMock.verify(mockProxy); }