Package com.opengamma.util.rest

Examples of com.opengamma.util.rest.UniformInterfaceException404NotFound


          public FudgeMsg answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return (FudgeMsg) server.get(uri.getPath().substring(8)).getEntity();
            } catch (final WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        return builder;
      }
View Full Code Here


          public ConventionBundle answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return OpenGammaFudgeContext.getInstance().fromFudgeMsg(ConventionBundle.class, (FudgeMsg) server.getByIdentifier(uri.getPath().substring(12)).getEntity());
            } catch (final WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        return builder;
      }
View Full Code Here

          public ConventionBundle answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return OpenGammaFudgeContext.getInstance().fromFudgeMsg(ConventionBundle.class, (FudgeMsg) server.getByBundle(Arrays.asList(uri.getQuery().substring(3))).getEntity());
            } catch (final WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        return builder;
      }
View Full Code Here

          public ConventionBundle answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return OpenGammaFudgeContext.getInstance().fromFudgeMsg(ConventionBundle.class, (FudgeMsg) server.getByUniqueId(uri.getPath().substring(8)).getEntity());
            } catch (final WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        return builder;
      }
View Full Code Here

                }
              }
              return (FudgeMsg) resolve.get().getEntity();
            } catch (WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        return builder;
      }
View Full Code Here

          public Object answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return answerGet(server, s).getEntity();
            } catch (final WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        return builder;
      }
View Full Code Here

          public FudgeMsg answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return (FudgeMsg) server.getByUniqueId(uri.getPath().substring(5)).getEntity();
            } catch (WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        return builder;
      }
View Full Code Here

          public FudgeMsg answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return (FudgeMsg) server.getByName(uri.getPath().substring(6)).getEntity();
            } catch (WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        return builder;
      }
View Full Code Here

          public Object answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return answerGet(server, s).getEntity();
            } catch (final WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        });
        Mockito.doAnswer(new Answer<Object>() {
          @Override
          public Object answer(final InvocationOnMock invocation) throws Throwable {
            try {
              return answerPost(server, invocation.getArguments()[0], s).getEntity();
            } catch (final WebApplicationException e) {
              assertEquals(e.getResponse().getStatus(), 404);
              throw new UniformInterfaceException404NotFound(new ClientResponse(404, null, null, null), false);
            }
          }
        }).when(builder).post(Mockito.any());
        return builder;
      }
View Full Code Here

TOP

Related Classes of com.opengamma.util.rest.UniformInterfaceException404NotFound

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.