use of com.google.api.generator.engine.ast.RelationalOperationExpr in project gapic-generator-java by googleapis.
the class ImportWriterVisitorTest method writeRelationalOperationExprImports.
@Test
public void writeRelationalOperationExprImports() {
MethodInvocationExpr lhsExpr = MethodInvocationExpr.builder().setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))).setMethodName("getSomething").setReturnType(TypeNode.STRING).build();
TypeNode someType = TypeNode.withReference(VaporReference.builder().setName("SomeClass").setPakkage("com.google.api.generator.engine").build());
MethodInvocationExpr rhsExpr = MethodInvocationExpr.builder().setMethodName("getName").setStaticReferenceType(someType).setReturnType(TypeNode.STRING).build();
RelationalOperationExpr relationalOperationExpr = RelationalOperationExpr.equalToWithExprs(lhsExpr, rhsExpr);
relationalOperationExpr.accept(writerVisitor);
assertEquals(LineFormatter.lines("import com.google.api.generator.engine.SomeClass;\n", "import com.google.api.generator.engine.ast.Expr;\n\n"), writerVisitor.write());
}
Aggregations