1   package com.atlassian.plugins.codegen.modules.common.component;
2   
3   import com.atlassian.plugins.codegen.AbstractCodegenTestCase;
4   
5   import org.junit.Before;
6   import org.junit.Test;
7   
8   import static org.junit.Assert.assertEquals;
9   
10  /**
11   * @since 3.6
12   */
13  public class ComponentImportTest extends AbstractCodegenTestCase<ComponentImportProperties>
14  {
15      @Before
16      public void setup() throws Exception
17      {
18          setCreator(new ComponentImportModuleCreator());
19  
20          setProps(new ComponentImportProperties("com.atlassian.SomeInterface"));
21          props.setIncludeExamples(false);
22      }
23  
24      @Test
25      public void createdComponentImport() throws Exception
26      {
27          assertEquals("expected a component import declaration", 1, getChangesetForModule().getComponentImports().size());
28      }
29      
30      @Test
31      public void componentImportHasInterface() throws Exception
32      {
33          assertEquals("com.atlassian.SomeInterface", getChangesetForModule().getComponentImports().get(0).getInterfaceClass().getFullName());
34      }
35  }