Skip to content

Commit

Permalink
Handle "is" like "get" in SampleReportingFormat.reportJavaBean()
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Aug 26, 2020
1 parent 70838a6 commit a8a1156
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
- Add abstract method DomainContextBase.registrations()

- Arbitraries.forType(Class<T> targetType)
- useBeanProperties()
- with optional spec: Map<String, Arbitrary> to map
a property to a certain arbitrary
- Preconfigure certain params (by type, by name)
- Recursive use
- forType(Class<T> targetType, int depth)
- @UseType(depth = 1)
- Preconfigure certain params (by type, by name)

- `@Repeat(42)`: Repeat a property 42 times

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ private String extractPropertyName(Method method) {
String methodName = method.getName();
String name = methodName.startsWith("get")
? methodName.substring(3)
: methodName;
: methodName.startsWith("is")
? methodName.substring(2)
: methodName;
name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ public Object report(Object value) {
assertThat(lineReporter.lines).containsSequence(
" {",
" age=17,",
" isYoung=true,",
" name=\"name\",",
" young=true,",
" yourObjects=[{hallo=\"hello\"}]",
" },"
);
Expand Down

0 comments on commit a8a1156

Please sign in to comment.