Package unit.validation

Source Code of unit.validation.URLValidationTest

package unit.validation;

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

public class URLValidationTest extends ValidationTest<URLModel> {

    @Override
    protected URLModelBuilder valid() {
        return new URLModelBuilder();
    }

    @Test
    public void url() {
        assertThat("url").withValue(null).isValid();
        assertThat("url").withValue("not a url!!").isInvalid();
        assertThat("url").mustBeAURL();

    }

    private class URLModelBuilder extends Builder<URLModel> {
        @Override
        public URLModel build() {
            URLModel model = new URLModel();
            model.url = "http://www.playframework.org";
            return model;
        }
    }
}
TOP

Related Classes of unit.validation.URLValidationTest

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.