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