All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.qadenz.automation.expectations.impl.TextContains Maven / Gradle / Ivy

There is a newer version: 2.1.2
Show newest version
/*
Copyright Tim Slifer

Licensed under the PolyForm Internal Use License, Version 1.0.0 (the "License");
you may not use this file except in compliance with the License.
A copy of the License may be obtained at

https://polyformproject.org/licenses/internal-use/1.0.0/
 */
package dev.qadenz.automation.expectations.impl;

import dev.qadenz.automation.expectations.Expectation;
import org.hamcrest.Matcher;
import org.hamcrest.core.StringContains;

/**
 * An Expectation for a String 'actual' value to contain the given 'expected' value.
 *
 * @author Tim Slifer
 */
public class TextContains implements Expectation {
    
    private String expectedText;
    
    public TextContains(String expectedText) {
        this.expectedText = expectedText;
    }
    
    @Override
    public Matcher matcher() {
        return new StringContains(false, expectedText);
    }
    
    @Override
    public String toString() {
        return "contains [" + expectedText + "]";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy