Examples of MockPojo


Examples of com.knappsack.swagger4springweb.testModels.MockPojo

    @RequestMapping(value = "/resource1", method = RequestMethod.GET, produces = "application/json")
    public
    @ResponseBody
    MockPojo apiOperation3ToInclude() {
        return new MockPojo();
    }
View Full Code Here

Examples of com.knappsack.swagger4springweb.testModels.MockPojo

    @RequestMapping(value = "/resource2", method = RequestMethod.GET, produces = "application/json")
    @ApiExclude
    public
    @ResponseBody
    MockPojo apiOperation4ToExclude() {
        return new MockPojo();
    }
View Full Code Here

Examples of com.knappsack.swagger4springweb.testModels.MockPojo

    @ResponseBody
    List<MockPojo> getTestPojos(HttpServletRequest request,
                                @ApiParam(name = "testVariable", value = "String")
                                @PathVariable String testVariable) {
        List<MockPojo> mockPojos = new ArrayList<MockPojo>();
        MockPojo mockPojo = new MockPojo();
        mockPojo.setId(1);
        mockPojo.setName("Test Pojo");
        mockPojo.setDescription("This is a test pojo for testing purposes.");
        mockPojos.add(mockPojo);

        return mockPojos;
    }
View Full Code Here

Examples of com.knappsack.swagger4springweb.testModels.MockPojo

    public
    @ResponseBody
    List<MockPojo> getTestPojosNoSwaggerAnnotations(HttpServletRequest request,
                                                    @PathVariable String testVariable) {
        List<MockPojo> mockPojos = new ArrayList<MockPojo>();
        MockPojo mockPojo = new MockPojo();
        mockPojo.setId(1);
        mockPojo.setName("Test Pojo");
        mockPojo.setDescription("This is a test pojo for testing purposes.");
        mockPojos.add(mockPojo);

        return mockPojos;
    }
View Full Code Here

Examples of com.knappsack.swagger4springweb.testModels.MockPojo

                                            @RequestParam Double doubleVariable,
                                            @RequestParam Date date) {
        List<MockPojo> mockPojos = new ArrayList<MockPojo>();

        if (testVariable != null && !testVariable.isEmpty()) {
            MockPojo mockPojo = new MockPojo();
            mockPojo.setId(1);
            mockPojo.setName("Test Pojo");
            mockPojo.setDescription("This is a test pojo for testing purposes.");
            mockPojos.add(mockPojo);
        }

        return mockPojos;
    }
View Full Code Here

Examples of com.knappsack.swagger4springweb.testModels.MockPojo

    @ResponseBody
    List<MockPojo> getTestPojoRequestHeader(HttpServletRequest request,
                                            @RequestHeader(("Accept-Encoding")) String encoding) {
        List<MockPojo> mockPojos = new ArrayList<MockPojo>();

        MockPojo mockPojo = new MockPojo();
        mockPojo.setId(1);
        mockPojo.setName("Test Pojo");
        mockPojo.setDescription("This is a test pojo for testing purposes.");
        mockPojos.add(mockPojo);

        return mockPojos;
    }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

   *
   */
  @Test
  public void testClickLinkInsideForm_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndContainedLink page = new MockPageWithFormAndContainedLink(mockPojo);
    page.addLink(new AjaxSubmitLink("link")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }

      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form)
      {
      }
    });

    tester.startPage(page);

    tester.assertRenderedPage(MockPageWithFormAndContainedLink.class);

    // Change the name in the textfield
    tester.getRequest()
      .getPostParameters()
      .setParameterValue(page.getNameField().getInputName(), "new mock value");

    // Click the submit link
    tester.clickLink("form:link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

   *
   */
  @Test
  public void testClickLink_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo);
    AjaxSubmitLink link = new AjaxSubmitLink("link", page.getForm())
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }

      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form)
      {
      }
    };
    page.add(link);

    tester.startPage(page);
    tester.assertRenderedPage(MockPageWithFormAndLink.class);

    // Change the name in the textfield
    tester.getRequest()
      .getPostParameters()
      .setParameterValue(page.getNameField().getInputName(), "new mock value");

    // Click the submit link
    tester.clickLink("link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLinkInsideForm_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndContainedLink page = new MockPageWithFormAndContainedLink(mockPojo);
    page.addLink(new AjaxSubmitLink("link")
    {
      private static final long serialVersionUID = 1L;

      protected void onSubmit(AjaxRequestTarget target, Form form)
      {
        assertNotNull(form);
        linkClicked = true;
      }
    });

    tester.startPage(new ITestPageSource()
    {
      private static final long serialVersionUID = 1L;

      public Page getTestPage()
      {
        return page;
      }
    });

    tester.assertRenderedPage(MockPageWithFormAndContainedLink.class);

    // Change the name in the textfield
    page.getNameField().setModelValue(new String[] { "new mock value" });

    // Click the submit link
    tester.clickLink("form:link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLink_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo);
    AjaxSubmitLink link = new AjaxSubmitLink("link", page.getForm())
    {
      private static final long serialVersionUID = 1L;

      protected void onSubmit(AjaxRequestTarget target, Form form)
      {
        assertNotNull(form);
        linkClicked = true;
      }
    };
    page.add(link);

    tester.startPage(new ITestPageSource()
    {
      private static final long serialVersionUID = 1L;

      public Page getTestPage()
      {
        return page;
      }
    });

    tester.assertRenderedPage(MockPageWithFormAndLink.class);

    // Change the name in the textfield
    page.getNameField().setModelValue(new String[] { "new mock value" });

    // Click the submit link
    tester.clickLink("link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
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.