@Test public void getPropertiesOfAllParentsTest() throws Exception { final GeneratedTransferObject superType = mock(GeneratedTransferObject.class); doReturn(enclosedType).when(superType).getSuperType(); assertTrue(GeneratorUtil.getPropertiesOfAllParents(superType).contains(property)); }
static List<GeneratedProperty> getPropertiesOfAllParents(final GeneratedTransferObject genTO) { List<GeneratedProperty> propertiesOfAllParents = new ArrayList<>(); if (genTO.getSuperType() != null) { final List<GeneratedProperty> allPropertiesOfTO = genTO.getSuperType().getProperties(); List<GeneratedProperty> readOnlyPropertiesOfTO = resolveReadOnlyPropertiesFromTO(allPropertiesOfTO); propertiesOfAllParents.addAll(readOnlyPropertiesOfTO); propertiesOfAllParents.addAll(getPropertiesOfAllParents(genTO.getSuperType())); } return propertiesOfAllParents; }
GeneratorUtil { static List<GeneratedProperty> getPropertiesOfAllParents(final GeneratedTransferObject genTO) { List<GeneratedProperty> propertiesOfAllParents = new ArrayList<>(); if (genTO.getSuperType() != null) { final List<GeneratedProperty> allPropertiesOfTO = genTO.getSuperType().getProperties(); List<GeneratedProperty> readOnlyPropertiesOfTO = resolveReadOnlyPropertiesFromTO(allPropertiesOfTO); propertiesOfAllParents.addAll(readOnlyPropertiesOfTO); propertiesOfAllParents.addAll(getPropertiesOfAllParents(genTO.getSuperType())); } return propertiesOfAllParents; } }
GeneratorUtil { static List<GeneratedProperty> getPropertiesOfAllParents(final GeneratedTransferObject genTO) { List<GeneratedProperty> propertiesOfAllParents = new ArrayList<>(); if (genTO.getSuperType() != null) { final List<GeneratedProperty> allPropertiesOfTO = genTO.getSuperType().getProperties(); List<GeneratedProperty> readOnlyPropertiesOfTO = resolveReadOnlyPropertiesFromTO(allPropertiesOfTO); propertiesOfAllParents.addAll(readOnlyPropertiesOfTO); propertiesOfAllParents.addAll(getPropertiesOfAllParents(genTO.getSuperType())); } return propertiesOfAllParents; } private  GeneratorUtil(); }
GeneratorUtil { static List<GeneratedProperty> getPropertiesOfAllParents(final GeneratedTransferObject genTO) { List<GeneratedProperty> propertiesOfAllParents = new ArrayList<>(); if (genTO.getSuperType() != null) { final List<GeneratedProperty> allPropertiesOfTO = genTO.getSuperType().getProperties(); List<GeneratedProperty> readOnlyPropertiesOfTO = resolveReadOnlyPropertiesFromTO(allPropertiesOfTO); propertiesOfAllParents.addAll(readOnlyPropertiesOfTO); propertiesOfAllParents.addAll(getPropertiesOfAllParents(genTO.getSuperType())); } return propertiesOfAllParents; } private  GeneratorUtil();  }
GeneratorUtil { static List<GeneratedProperty> getPropertiesOfAllParents(final GeneratedTransferObject genTO) { List<GeneratedProperty> propertiesOfAllParents = new ArrayList<>(); if (genTO.getSuperType() != null) { final List<GeneratedProperty> allPropertiesOfTO = genTO.getSuperType().getProperties(); List<GeneratedProperty> readOnlyPropertiesOfTO = resolveReadOnlyPropertiesFromTO(allPropertiesOfTO); propertiesOfAllParents.addAll(readOnlyPropertiesOfTO); propertiesOfAllParents.addAll(getPropertiesOfAllParents(genTO.getSuperType())); } return propertiesOfAllParents; } private  GeneratorUtil();   }