DATACMNS-107 - Added support for True and False as query method keywords.

This commit is contained in:
Oliver Gierke
2011-12-05 12:52:52 +01:00
parent f7b796dcee
commit 498f40b69f
2 changed files with 30 additions and 1 deletions

View File

@@ -259,6 +259,32 @@ public class PartTreeUnitTests {
assertThat(part.getParameterRequired(), is(true));
}
/**
* @see DATACMNS-107
*/
@Test
public void parsesTrueKeywordCorrectly() {
Part part = part("activeTrue");
assertThat(part.getType(), is(Type.TRUE));
assertThat(part.getProperty().toDotPath(), is("active"));
assertThat(part.getNumberOfArguments(), is(0));
assertThat(part.getParameterRequired(), is(false));
}
/**
* @see DATACMNS-107
*/
@Test
public void parsesFalseKeywordCorrectly() {
Part part = part("activeTrue");
assertThat(part.getType(), is(Type.TRUE));
assertThat(part.getProperty().toDotPath(), is("active"));
assertThat(part.getNumberOfArguments(), is(0));
assertThat(part.getParameterRequired(), is(false));
}
private PartTree partTree(String source) {
return new PartTree(source, User.class);
}
@@ -307,5 +333,6 @@ public class PartTreeUnitTests {
String firstname;
String lastname;
double[] location;
boolean active;
}
}