Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Commit 8e2d87c

Browse files
committed
Add compile-time test for @part
1 parent 9a48bef commit 8e2d87c

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎AndroidAnnotations/androidannotations-rest-spring/rest-spring/src/test/java/org/androidannotations/rest/spring/ClientWithWrongFields.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.androidannotations.rest.spring;
1717

1818
import org.androidannotations.rest.spring.annotations.Field;
19+
import org.androidannotations.rest.spring.annotations.Part;
1920
import org.androidannotations.rest.spring.annotations.Path;
2021
import org.androidannotations.rest.spring.annotations.Post;
2122
import org.androidannotations.rest.spring.annotations.Rest;
@@ -40,4 +41,7 @@ public interface ClientWithWrongFields {
4041
void fieldAndEntity(@Field int v1, String entity);
4142

4243
void missingPostAnnotation(@Field("missingPost") int v1);
44+
45+
@Post("/fieldAndPartOnSameMethod")
46+
void fieldAndPartOnSameMethod(@Field String field, @Part String part);
4347
}

‎AndroidAnnotations/androidannotations-rest-spring/rest-spring/src/test/java/org/androidannotations/rest/spring/RestTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ public void clientWithWrongPostParameters() throws IOException {
107107
assertCompilationErrorOn(ClientWithWrongFields.class, "@Path(\"pathParamConflict\")", result);
108108
assertCompilationErrorOn(ClientWithWrongFields.class, "@Post(\"/conflictWithPathParam\")", result);
109109
assertCompilationErrorOn(ClientWithWrongFields.class, "@Post(\"/duplicateField\")", result);
110+
assertCompilationErrorOn(ClientWithWrongFields.class, "@Post(\"/fieldAndPartOnSameMethod\")", result);
110111

111-
assertCompilationErrorCount(10, result);
112+
assertCompilationErrorCount(11, result);
112113
}
113114

114115
@Test

0 commit comments

Comments
 (0)