use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileWithoutUpdateUri.
@Test
public void shouldNotCompileWithoutUpdateUri() {
JavaFileObject model = JavaFileObjects.forResource("NoUpdateUri.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Uri of NoUpdateUri annotated with StorIOContentResolverType is empty for operation update");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfTypeIsUnsupported.
@Test
public void shouldNotCompileIfTypeIsUnsupported() {
JavaFileObject model = JavaFileObjects.forResource("UnsupportedType.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Unsupported type of field or method for StorIOContentResolverColumn annotation, if you need to" + " serialize/deserialize field of that type -> please write your own resolver");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfColumnNameIsEmpty.
@Test
public void shouldNotCompileIfColumnNameIsEmpty() {
JavaFileObject model = JavaFileObjects.forResource("EmptyColumnName.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Column name is empty: id");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfIgnoreNullIsUsedOnPrimitive.
@Test
public void shouldNotCompileIfIgnoreNullIsUsedOnPrimitive() {
JavaFileObject model = JavaFileObjects.forResource("IgnoreNullOnPrimitive.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("ignoreNull should not be used for primitive type: id");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithMethodsReturningBoxedTypesAndFactoryMethodAsCreator.
@Test
public void shouldCompileWithMethodsReturningBoxedTypesAndFactoryMethodAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethod.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOContentResolverPutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
Aggregations