Skip to content

#102 fix NullPointerException when searching for Transient annotation #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public boolean isAnnotationPresent(Class<? extends Annotation> annotation) {
.isAnnotationPresent(annotation);

} catch (NoSuchFieldException e) {
if(delegate.getReadMethod() == null) return false;
answer = delegate.getReadMethod()
.isAnnotationPresent(annotation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,14 @@ public void correctlyDerivesSchemaDescriptionsFromGivenEntities() {
.describedAs( "Ensure that CodeList.parent has the expected description")
.isEqualTo("The CodeList's parent CodeList");
}

@Test
public void testBuildSchema(){
//given
GraphQLSchema schema = builder.build();

//then
assertThat(schema).isNotNull();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public void testNotTransientFields() throws Exception {
assertThat(IntrospectionUtils.isTransient(entity, "info")).isFalse();
assertThat(IntrospectionUtils.isTransient(entity, "title")).isFalse();
}



@Test
public void testByPassSetMethod() throws Exception {
// given
Class<CalculatedEntity> entity = CalculatedEntity.class;

// then
assertThat(IntrospectionUtils.isTransient(entity,"something")).isFalse();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ public boolean isCustomLogic() {
public String getHideFieldFunction() {
return "getHideFieldFunction";
}

public void setSomething(int a){}
}