Package unit.validation

Source Code of unit.validation.MatchValidationTest

package unit.validation;

import litmus.Builder;
import litmus.unit.validation.ValidationTest;
import models.MatchModel;
import org.junit.Test;

import static litmus.unit.validation.BuiltInValidation.MATCH;

public class MatchValidationTest extends ValidationTest<MatchModel> {

  @Override
  protected Builder<MatchModel> valid() {
    return new MatchModelBuilder();
  }

  @Test
  public void match() {
    assertThat("matchingString").withValue("aaa").hasValidationError(MATCH);
  }

    private class MatchModelBuilder extends Builder<MatchModel> {
        @Override
        public MatchModel build() {
            MatchModel model = new MatchModel();
            model.matchingString = "1290";
            return model;
        }
    }
}
TOP

Related Classes of unit.validation.MatchValidationTest

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.