/*
 * Copyright 2015 The original authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package io.sundr.builder.internal.functions;

import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;

import org.junit.Test;

import com.sun.tools.javac.model.JavacElements;
import com.sun.tools.javac.model.JavacTypes;
import com.sun.tools.javac.util.Context;

import io.sundr.builder.Constants;
import io.sundr.builder.internal.BuilderContext;
import io.sundr.builder.internal.BuilderContextManager;
import io.sundr.model.Method;
import io.sundr.model.MethodBuilder;
import io.sundr.model.TypeDef;
import io.sundr.model.TypeDefBuilder;

public class ClazzAsTest {

  private final Context context = new Context();
  private final Elements elements = JavacElements.instance(context);
  private final Types types = JavacTypes.instance(context);

  @Test
  public void testToFluent() {
    BuilderContext builderContext = BuilderContextManager.create(elements, types);

    TypeDef type = new TypeDefBuilder()
        .withName("MyClass")
        .withPackageName(getClass().getPackage().getName())
        .withParameters()
        .build();

    Method constructor = new MethodBuilder()
        .withReturnType(type.toReference())
        .withAnnotations(Constants.BUILDABLE_ANNOTATION)
        .build();

    type = new TypeDefBuilder(type)
        .withConstructors(constructor)
        .build();

    TypeDef result = ClazzAs.FLUENT_IMPL.apply(type);
    System.out.println(result);
  }
}

@@ -683,842 +683,359 @@
 ort 
-javax.lang.model.util.Elements;%0Aimport javax.lang.model.util.Types;%0A%0Aimport org.junit.Test;%0A%0Aimport com.sun.tools.javac.model.JavacElements;%0Aimport com.sun.tools.javac.model.JavacTypes;%0Aimport com.sun.tools.javac.util.Context;%0A%0Aimport io.sundr.builder.Constants;%0Aimport io.sundr.builder.internal.BuilderContext;%0Aimport io.sundr.builder.internal.BuilderContextManager;%0Aimport io.sundr.model.Method;%0Aimport io.sundr.model.MethodBuilder;%0Aimport io.sundr.model.TypeDef;%0Aimport io.sundr.model.TypeDefBuilder;%0A%0Apublic class ClazzAsTest %7B%0A%0A  private final Context context = new Context();%0A  private final Elements elements = JavacElements.instance(context);%0A  private final Types types = JavacTypes.instance(context);%0A%0A  @Test%0A  public void testToFluent() %7B%0A    BuilderContext builderContext = BuilderContextManager.create(elements, types);%0A
+org.junit.Test;%0A%0Aimport io.sundr.builder.Constants;%0Aimport io.sundr.builder.internal.processor.AbstractProcessorTest;%0Aimport io.sundr.model.Method;%0Aimport io.sundr.model.MethodBuilder;%0Aimport io.sundr.model.TypeDef;%0Aimport io.sundr.model.TypeDefBuilder;%0A%0Apublic class ClazzAsTest extends AbstractProcessorTest %7B%0A%0A  @Test%0A  public void testToFluent() %7B
 %0A   

remove references to com.sun.tools