buildExportCatchBlock(bodyBuilder, JR_EXCEPTION); buildExportCatchBlock(bodyBuilder, IO_EXCEPTION); bodyBuilder.reset();
body.indentRemove(); body.appendFormalLine(".build().encode();"); body.reset();
/** * Builds a method annotated with `@Before` which checks if data-on-demand * field has initialized correctly. * * @return {@link MethodMetadata} */ private MethodMetadata getBeforeMethod() { MethodMetadata method = getGovernorMethod(BEFORE_METHOD_NAME); if (method != null) { return method; } InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); // assertThat(dod.getRandomPet()) bodyBuilder.appendFormalLine("%s(%s().%s())", getNameOfJavaType(ASSERT_THAT, true), getAccessorMethod(this.dodField).getMethodName(), this.getRandomMethodName); // .as("Check data on demand for 'Pet' initializes correctly by getting a random Pet") bodyBuilder.indent(); bodyBuilder.appendFormalLine( ".as(\"Check data on demand for '%1$s' initializes correctly by getting a random %1$s\")", getNameOfJavaType(this.entity)); // .isNotNull(); bodyBuilder.appendFormalLine(".isNotNull();"); bodyBuilder.reset(); MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC, BEFORE_METHOD_NAME, JavaType.VOID_PRIMITIVE, bodyBuilder); // Add @Before methodBuilder.addAnnotation(new AnnotationMetadataBuilder(BEFORE)); return methodBuilder.build(); }
bodyBuilder.appendFormalLine(".isEqualTo(%1$s.%3$s()).isEqualTo(%2$s.%3$s());", childEntityVar1, childEntityVar2, parentEntityAccessor); bodyBuilder.reset();
bodyBuilder.appendFormalLine(".doesNotContain(%s).contains(%s);", childEntityVar1, childEntityVar2); bodyBuilder.reset();
bodyBuilder.reset();
bodyBuilder.appendFormalLine(".isEqualTo(%s.%s());", this.entityVar, this.identifierAccessorMethodName); bodyBuilder.reset();
bodyBuilder.reset();
bodyBuilder.reset();
bodyBuilder.reset();
bodyBuilder.reset();
bodyBuilder.reset();
bodyBuilder.reset();
bodyBuilder.reset();
/** * Builds a method annotated with `@Before` which checks if data-on-demand * field has initialized correctly. * * @return {@link MethodMetadata} */ private MethodMetadata getBeforeMethod() { MethodMetadata method = getGovernorMethod(BEFORE_METHOD_NAME); if (method != null) { return method; } InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); // assertThat(dod.getRandomPet()) bodyBuilder.appendFormalLine("%s(%s().%s())", getNameOfJavaType(ASSERT_THAT, true), getAccessorMethod(this.dodField).getMethodName(), this.getRandomMethodName); // .as("Check data on demand for 'Pet' initializes correctly by getting a random Pet") bodyBuilder.indent(); bodyBuilder.appendFormalLine( ".as(\"Check data on demand for '%1$s' initializes correctly by getting a random %1$s\")", getNameOfJavaType(this.entity)); // .isNotNull(); bodyBuilder.appendFormalLine(".isNotNull();"); bodyBuilder.reset(); MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC, BEFORE_METHOD_NAME, JavaType.VOID_PRIMITIVE, bodyBuilder); // Add @Before methodBuilder.addAnnotation(new AnnotationMetadataBuilder(BEFORE)); return methodBuilder.build(); }
bodyBuilder.appendFormalLine(".doesNotContain(%s).contains(%s);", childEntityVar1, childEntityVar2); bodyBuilder.reset();
bodyBuilder.appendFormalLine(".isEqualTo(%s.%s());", this.entityVar, this.identifierAccessorMethodName); bodyBuilder.reset();
bodyBuilder.reset();
bodyBuilder.reset();