@Test public void checkGetPackage() { Name simpleName = mock(Name.class); when(simpleName.toString()).thenReturn("Test"); Name qualifiedName = mock(Name.class); when(qualifiedName.toString()).thenReturn("com.example.Test"); TypeElement element = mock(TypeElement.class); when(element.getSimpleName()).thenReturn(simpleName); when(element.getQualifiedName()).thenReturn(qualifiedName); MapperModel object = new MapperModel(element); ASSERT.that("com.example").isEqualTo(object.getPackage()); }
@Override public String getPackage() { final String simpleName = element.getSimpleName().toString(); final String qualifiedName = element.getQualifiedName().toString(); return qualifiedName.substring(0, qualifiedName.length() - simpleName.length() - 1); }
MapperModel implements EntityData { @Override public String getPackage() { final String simpleName = element.getSimpleName().toString(); final String qualifiedName = element.getQualifiedName().toString(); return qualifiedName.substring(0, qualifiedName.length() - simpleName.length() - 1); } }
MapperModel implements EntityData { @Override public String getPackage() { final String simpleName = element.getSimpleName().toString(); final String qualifiedName = element.getQualifiedName().toString(); return qualifiedName.substring(0, qualifiedName.length() - simpleName.length() - 1); } MapperModel(TypeElement element); }
MapperModel implements EntityData { @Override public String getPackage() { final String simpleName = element.getSimpleName().toString(); final String qualifiedName = element.getQualifiedName().toString(); return qualifiedName.substring(0, qualifiedName.length() - simpleName.length() - 1); } MapperModel(TypeElement element); @Override String getName(); @Override String getFullQualifiedName(); @Override String getPackage(); @Override String getVariable(); }
MapperModel implements EntityData { @Override public String getPackage() { final String simpleName = element.getSimpleName().toString(); final String qualifiedName = element.getQualifiedName().toString(); return qualifiedName.substring(0, qualifiedName.length() - simpleName.length() - 1); } MapperModel(TypeElement element); @Override String getName(); @Override String getFullQualifiedName(); @Override String getPackage(); @Override String getVariable();  }