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

com.github.alkedr.matchers.reporting.NoOpMatcher Maven / Gradle / Ivy

The newest version!
package com.github.alkedr.matchers.reporting;

import com.github.alkedr.matchers.reporting.reporters.SafeTreeReporter;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;

// matches всегда возвращает true, в отчёт никогда ничего не добавляется
class NoOpMatcher extends BaseMatcher implements ReportingMatcher {
    static final NoOpMatcher INSTANCE = new NoOpMatcher<>();

    @Override
    public void run(Object item, SafeTreeReporter safeTreeReporter) {
    }

    @Override
    public void runForAbsentItem(SafeTreeReporter safeTreeReporter) {
    }


    @Override
    public boolean matches(Object item) {
        return true;
    }

    @Override
    public void describeTo(Description description) {
        description.appendText("anything");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy