Examples of findActionMethod()


Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

                    version,
                    "/test?action=longParam",
                    jsonEntityBody,
                    buildPathKeys());

    methodDescriptor = model.findActionMethod("byteStringParam", ResourceLevel.COLLECTION);
    resource = getMockResource(CombinedResources.TestActionsResource.class);
    String str = "test string";
    ByteString expectedByteString = ByteString.copyString(str, "UTF-8");
    resource.byteStringParam(expectedByteString);
    EasyMock.expectLastCall().once();
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

                    version,
                    "/test?action=byteStringParam",
                    jsonEntityBody,
                    buildPathKeys());

    methodDescriptor = model.findActionMethod("floatParam", ResourceLevel.COLLECTION);
    resource = getMockResource(CombinedResources.TestActionsResource.class);
    float expectedFloat = DataTemplateUtil.coerceOutput(Double.MAX_VALUE, Float.class);
    resource.floatParam(expectedFloat);
    EasyMock.expectLastCall().once();
    jsonEntityBody = RestLiTestHelper.doubleQuote("{'floatParam': " + String.valueOf(Double.MAX_VALUE) + "}");
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

                    version,
                    "/test?action=floatParam",
                    jsonEntityBody,
                    buildPathKeys());

    methodDescriptor = model.findActionMethod("doubleParam", ResourceLevel.COLLECTION);
    resource = getMockResource(CombinedResources.TestActionsResource.class);
    float floatValue = 567.5f;
    double expectedDouble = DataTemplateUtil.coerceOutput(floatValue, Double.class);
    resource.doubleParam(expectedDouble);
    EasyMock.expectLastCall().once();
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

                    version,
                    "/test?action=doubleParam",
                    jsonEntityBody,
                    buildPathKeys());

    methodDescriptor = model.findActionMethod("recordParam", ResourceLevel.COLLECTION);
    resource = getMockResource(CombinedResources.TestActionsResource.class);

    TestRecord expectedRecord = new TestRecord();
    expectedRecord.setIntField(expectedInt);
    expectedRecord.setLongField(expectedLong);
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

    checkParam(methodDescriptor, "keywords", String.class, null);
    checkParam(methodDescriptor, "since", long.class, -1L);
    checkParam(methodDescriptor, "type", StatusType.class, null);
    assertNull(methodDescriptor.getParameter("foo"));

    assertNull(statusResourceModel.findActionMethod("foo", ResourceLevel.COLLECTION));

    assertNotNull(statusResourceModel.findMethod(ResourceMethod.BATCH_GET));
    assertNotNull(statusResourceModel.findMethod(ResourceMethod.CREATE));
    assertNotNull(statusResourceModel.findMethod(ResourceMethod.BATCH_CREATE));
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

    checkParam(methodDescriptor, "keywords", String.class, null);
    checkParam(methodDescriptor, "since", long.class, -1L);
    checkParam(methodDescriptor, "type", StatusType.class, null);
    assertNull(methodDescriptor.getParameter("foo"));

    assertNull(statusResourceModel.findActionMethod("foo", ResourceLevel.COLLECTION));

    assertNotNull(statusResourceModel.findMethod(ResourceMethod.BATCH_GET));
    assertNotNull(statusResourceModel.findMethod(ResourceMethod.CREATE));
    assertNotNull(statusResourceModel.findMethod(ResourceMethod.BATCH_CREATE));
    assertNotNull(statusResourceModel.findMethod(ResourceMethod.BATCH_DELETE));
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

    ResourceModel resourceModel = buildResourceModel(TwitterAccountsResource.class);
    assertEquals(resourceModel.getResourceType(), ResourceType.ACTIONS);

    assertEquals(resourceModel.getResourceMethodDescriptors().size(), 5);

    ResourceMethodDescriptor methodDescriptor = resourceModel.findActionMethod("register", ResourceLevel.COLLECTION);
    assertNotNull(methodDescriptor);
    assertEquals(methodDescriptor.getActionName(), "register");
    assertNull(methodDescriptor.getFinderName());
    assertNotNull(methodDescriptor.getMethod());
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

    Parameter<?> marketingParam = methodDescriptor.getParameter("openToMarketingEmails");
    assertTrue(marketingParam.isOptional());
    assertTrue(marketingParam.hasDefaultValue());
    assertEquals(marketingParam.getDefaultValue(), true);

    methodDescriptor = resourceModel.findActionMethod("closeAccounts", ResourceLevel.COLLECTION);
    Parameter<?> optionsParam  = methodDescriptor.getParameter("options");
    assertTrue(optionsParam.isOptional());
    assertFalse(optionsParam.hasDefaultValue());
    assertNull(optionsParam.getDefaultValue());
  }
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

    ResourceModel collectionModel = buildResourceModel(StatusCollectionResource.class);
    assertEquals(collectionModel.getResourceType(), ResourceType.COLLECTION);

    assertEquals(0, countActions(collectionModel, ResourceLevel.COLLECTION));
    assertEquals(1, countActions(collectionModel, ResourceLevel.ENTITY));
    assertNotNull(collectionModel.findActionMethod("forward", ResourceLevel.ENTITY));
  }

  @Test
  public void testCombinedResourceClasses() throws Exception
  {
View Full Code Here

Examples of com.linkedin.restli.internal.server.model.ResourceModel.findActionMethod()

    assertEquals(resourceModel.getResourceMethodDescriptors().size(), 2);

    final ResourceMethodDescriptor getMethod = resourceModel.findMethod(ResourceMethod.GET);
    assertNotNull(getMethod);

    final ResourceMethodDescriptor actionMethod = resourceModel.findActionMethod("exception", ResourceLevel.COLLECTION);
    assertNotNull(actionMethod);
    final Class<?> returnClass = actionMethod.getActionReturnType();
    assertSame(returnClass, Integer.class);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.