junitparams.converters.Nullable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JUnitParams Show documentation
Show all versions of JUnitParams Show documentation
Better parameterised tests for JUnit
package junitparams.converters;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import junitparams.Parameters;
/**
* Allows test null values defined as a String array in {@link Parameters}
*
* @author Peter Jurkovic
*
*
* Example:
*
* {@literal @}Test
* {@literal @}Parameters({" null "})
* public void shouldBeNull({@literal @}Nullable String value) {
* assertThat(value).isNull();
* }
*
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Param(converter = NullableConverter.class)
@Target({ElementType.ANNOTATION_TYPE, ElementType.PARAMETER})
public @interface Nullable {
/**
* Defines parameter value which will be replaced by Java null
*/
String nullIdentifier() default "null";
}