Package org.wicketstuff.rest.domain

Examples of org.wicketstuff.rest.domain.PersonPojo


    }

    @Test
    public void testCreatePerson()
    {
  String jsonObj = gson.toJson(new PersonPojo("James Smith",
    "james@smith.com", "changeit"));

  mockRequest.setTextAsRequestBody(jsonObj);

  tester.setRequest(mockRequest);
View Full Code Here


    }

    @Test
    public void testValidatorBundle()
    {
  String jsonObj = gson.toJson(new PersonPojo("James Smith",
    "notValidMail", "changeit"));

  mockRequest.setTextAsRequestBody(jsonObj);

  tester.setRequest(mockRequest);
View Full Code Here

    private final List<PersonPojo> persons = new ArrayList<PersonPojo>();

    public PersonsRestResource() {
  super(new JsonWebSerialDeserial(new GsonObjectSerialDeserial()));
 
        persons.add(new PersonPojo("Freddie Mercury", "fmercury@queen.com", "Eeehooo!"));
        persons.add(new PersonPojo("John Deacon", "jdeacon@queen.com", "bass"));
        persons.add(new PersonPojo("Brian May", "bmay@queen.com", "guitar"));
        persons.add(new PersonPojo("Roger Taylor", "rtaylor@queen.com", "drum"));
    }
View Full Code Here

    private final Pattern emailPattern = EmailAddressValidator.getInstance().getPattern();

    @Override
    public void validate(IValidatable<PersonPojo> validatable) {

        PersonPojo person = validatable.getValue();
        Matcher matcher = emailPattern.matcher(person.getEmail());

        if (!matcher.matches()) {
            validatable.error(new RestValidationError(Arrays.asList(INVALID_MAIL_KEY),
                    Collections.EMPTY_MAP, "email"));
        }
View Full Code Here

TOP

Related Classes of org.wicketstuff.rest.domain.PersonPojo

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.