@Test public void testCreateMethod() throws Exception { NavigableAnnotatedClass navigableAnnotatedClass = Mockito.mock(NavigableAnnotatedClass.class); List<MethodSpec> method = navigatorCodeGenerator.createMethod(navigableAnnotatedClass); }
List<MethodSpec> createMethod(NavigableAnnotatedClass value) { ArrayList<MethodSpec> methods = new ArrayList<>(); if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() == 0) { methods.add(handleNoParamNoResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() == 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() > 0) { methods.add(handleResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() > 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else { throw new RuntimeException("Unpredicted situation"); } return methods; }
NavigatorCodeGenerator { List<MethodSpec> createMethod(NavigableAnnotatedClass value) { ArrayList<MethodSpec> methods = new ArrayList<>(); if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() == 0) { methods.add(handleNoParamNoResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() == 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() > 0) { methods.add(handleResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() > 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else { throw new RuntimeException("Unpredicted situation"); } return methods; } }
NavigatorCodeGenerator { List<MethodSpec> createMethod(NavigableAnnotatedClass value) { ArrayList<MethodSpec> methods = new ArrayList<>(); if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() == 0) { methods.add(handleNoParamNoResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() == 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() > 0) { methods.add(handleResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() > 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else { throw new RuntimeException("Unpredicted situation"); } return methods; } NavigatorCodeGenerator(ProcessingEnvironment processingEnv); }
NavigatorCodeGenerator { List<MethodSpec> createMethod(NavigableAnnotatedClass value) { ArrayList<MethodSpec> methods = new ArrayList<>(); if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() == 0) { methods.add(handleNoParamNoResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() == 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() > 0) { methods.add(handleResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() > 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else { throw new RuntimeException("Unpredicted situation"); } return methods; } NavigatorCodeGenerator(ProcessingEnvironment processingEnv); void generateClass(List<NavigableAnnotatedClass> navigableAnnotatedClassList); }
NavigatorCodeGenerator { List<MethodSpec> createMethod(NavigableAnnotatedClass value) { ArrayList<MethodSpec> methods = new ArrayList<>(); if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() == 0) { methods.add(handleNoParamNoResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() == 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else if (value.getParamAnnotatedFields().size() == 0 && value.getResultAnnotatedFields().size() > 0) { methods.add(handleResultActivity(value)); } else if (value.getParamAnnotatedFields().size() > 0 && value.getResultAnnotatedFields().size() > 0) { for (String group : value.getParamAnnotatedFields().keySet()) { methods.add(handleParamActivity(group, value)); } } else { throw new RuntimeException("Unpredicted situation"); } return methods; } NavigatorCodeGenerator(ProcessingEnvironment processingEnv); void generateClass(List<NavigableAnnotatedClass> navigableAnnotatedClassList);  }