Java Code Examples for org.hamcrest.CoreMatchers#equalTo()

The following examples show how to use org.hamcrest.CoreMatchers#equalTo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeTestingUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
public static Matcher<DataType> hasLogicalType(LogicalType logicalType) {
	return new FeatureMatcher<DataType, LogicalType>(
			CoreMatchers.equalTo(logicalType),
			"logical type of the data type",
			"logical type") {

		@Override
		protected LogicalType featureValueOf(DataType actual) {
			return actual.getLogicalType();
		}
	};
}
 
Example 2
Source File: TypeTestingUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
public static Matcher<DataType> hasConversionClass(Class<?> clazz) {
	return new FeatureMatcher<DataType, Class<?>>(
			CoreMatchers.equalTo(clazz),
			"conversion class of the data type",
			"conversion class") {

		@Override
		protected Class<?> featureValueOf(DataType actual) {
			return actual.getConversionClass();
		}
	};
}
 
Example 3
Source File: TypeTestingUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
public static Matcher<DataType> hasNullability(boolean isNullable) {
	return new FeatureMatcher<DataType, Boolean>(
			CoreMatchers.equalTo(isNullable),
			"nullability of the data type",
			"nullability") {

		@Override
		protected Boolean featureValueOf(DataType actual) {
			return actual.getLogicalType().isNullable();
		}
	};
}
 
Example 4
Source File: TypeTestingUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
public static Matcher<DataType> hasLogicalType(LogicalType logicalType) {
	return new FeatureMatcher<DataType, LogicalType>(
			CoreMatchers.equalTo(logicalType),
			"logical type of the data type",
			"logical type") {

		@Override
		protected LogicalType featureValueOf(DataType actual) {
			return actual.getLogicalType();
		}
	};
}
 
Example 5
Source File: TypeTestingUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
public static Matcher<DataType> hasConversionClass(Class<?> clazz) {
	return new FeatureMatcher<DataType, Class<?>>(
			CoreMatchers.equalTo(clazz),
			"conversion class of the data type",
			"conversion class") {

		@Override
		protected Class<?> featureValueOf(DataType actual) {
			return actual.getConversionClass();
		}
	};
}
 
Example 6
Source File: TypeTestingUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
public static Matcher<DataType> hasNullability(boolean isNullable) {
	return new FeatureMatcher<DataType, Boolean>(
			CoreMatchers.equalTo(isNullable),
			"nullability of the data type",
			"nullability") {

		@Override
		protected Boolean featureValueOf(DataType actual) {
			return actual.getLogicalType().isNullable();
		}
	};
}
 
Example 7
Source File: GeneratedKeysSupportFactoryTest.java    From jaybird with GNU Lesser General Public License v2.1 4 votes vote down vote up
private static Matcher<Set<GeneratedKeysSupport.QueryType>> equalTo(Set<GeneratedKeysSupport.QueryType> types) {
    return CoreMatchers.equalTo(types);
}
 
Example 8
Source File: JenkinsMatchers.java    From jenkins-test-harness with MIT License 2 votes vote down vote up
/**
 * Returns a Matcher for the plain text value of a Secret.
 * @since 2.50
 */
public static Matcher<Secret> hasPlainText(String expected) {
    return new HasPlainText(CoreMatchers.equalTo(expected));
}