GroupResolver { public String resolveGroup(Class<?> domainType) { String packageName = domainType.getPackage().getName(); if(packageName.contains(DOMAIN_SUB_PACKAGE)) { packageName = packageName.substring(0, packageName.lastIndexOf(DOMAIN_SUB_PACKAGE)); } return packageName; }  String resolveGroup(Class<?> domainType); static final String DOMAIN_SUB_PACKAGE; }
@Test public void testSimple() throws Exception { assertEquals("org.moserp.common.structure", resolver.resolveGroup(GroupResolverTestEntitySimple.class)); }
@Test public void testDomain() throws Exception { assertEquals("org.moserp.common.structure", resolver.resolveGroup(SimpleClass.class)); }
@Test public void testDomainWithSubPackage() throws Exception { assertEquals("org.moserp.common.structure", resolver.resolveGroup(GroupResolverTestEntityDomainWithSub.class)); }