OcelotProcessor extends AbstractProcessor { String getJsDirectory(Map<String, String> options) { if (null != options) { if (options.containsKey(ProcessorConstants.DIRECTORY)) { return options.get(ProcessorConstants.DIRECTORY); } } return null; }  @Override void init(ProcessingEnvironment processingEnv); @Override boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv); void processElement(Element element);  }
@Test public void getJsDirectoryTest() { System.out.println("getJsDirectory"); Map<String, String> map = new HashMap<>(); Object result = instance.getJsDirectory(map); assertThat(result).isNull(); String path = "/home/services"; map.put(ProcessorConstants.DIRECTORY, path); result = instance.getJsDirectory(map); assertThat(result).isEqualTo(path); map.put(ProcessorConstants.DIRECTORY, null); result = instance.getJsDirectory(map); assertThat(result).isNull(); result = instance.getJsDirectory(null); assertThat(result).isNull(); }