Package com.opengamma.transport.jaxrs

Examples of com.opengamma.transport.jaxrs.FudgeResponse


  private Object encode(Object value) {
    if (value instanceof FudgeMsgEnvelope || value instanceof FudgeMsg || value instanceof Bean) {
      return value;
    }
    return new FudgeResponse(value);
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  @Test
  public void testSearch() throws Exception {
    BatchRunSearchRequest batchRunSearchRequest = new BatchRunSearchRequest();
   
    FudgeResponse entity = (FudgeResponse) batchMasterResource.searchBatchRuns(batchRunSearchRequest).getEntity();
    Pair<List<RiskRun>, Paging> result = (Pair<List<RiskRun>, Paging>) entity.getValue();
   
    assertTrue(result.getFirst().size() > 0);
    RiskRun run = result.getFirst().get(0);
    assertEquals(run, riskRun);
  }
View Full Code Here

    List<MarketData> marketDataList = newArrayList(riskRun.getMarketData());
    Paging paging = Paging.of(pagingRequest, marketDataList);
     
    when(batchMaster.getMarketData((PagingRequest) any())).thenReturn(Pair.of(marketDataList, paging));
   
    FudgeResponse entity = (FudgeResponse) batchMasterResource.searchMarketData(pagingRequest).getEntity();
    Pair<List<MarketData>, Paging> response = (Pair<List<MarketData>, Paging>) entity.getValue();

    assertEquals(response.getFirst().size(), 1);
    assertEquals(response.getSecond(), paging);
  }
View Full Code Here

    Paging paging = Paging.of(pagingRequest, viewResultEntries);
   
    when(_underlying.getBatchValues(_riskRunId, pagingRequest)).thenReturn(Pair.of(viewResultEntries, paging));
    Response response = _resource.getBatchValues(pagingRequest);
   
    FudgeResponse entity = (FudgeResponse) response.getEntity();
    Pair<List<ViewResultEntry>, Paging> result = (Pair<List<ViewResultEntry>, Paging>) entity.getValue();
   
    assertEquals(Status.OK.getStatusCode(), response.getStatus());
    assertSame(result.getFirst().size(), 1);
    assertSame(result.getFirst().get(0), mockViewResultEntry);
    assertSame(result.getSecond(), paging);
View Full Code Here

TOP

Related Classes of com.opengamma.transport.jaxrs.FudgeResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.