@Test public void testCheckConfig() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, DependencyResolutionRequiredException { DefaultContractsGenerator defaultContractsGenerator = new DefaultContractsGenerator(); Method method = defaultContractsGenerator.getClass().getDeclaredMethod("checkConfig", new Class[] {}); method.setAccessible(true); defaultContractsGenerator.configure(null); assertThat(method.invoke(defaultContractsGenerator), is(false)); Map<String, Object> config = new HashMap<>(); config.put("classpathUrls", null); defaultContractsGenerator.configure(config); assertThat(method.invoke(defaultContractsGenerator), is(false)); MavenProject project = new MavenProject(); config.put("classpathUrls", project.getRuntimeClasspathElements()); defaultContractsGenerator.configure(config); assertThat(method.invoke(defaultContractsGenerator), is(true)); }
private boolean checkConfig() { return config != null && classpathUrls != null; }
DefaultContractsGenerator implements ContractsGenerator { private boolean checkConfig() { return config != null && classpathUrls != null; } }
DefaultContractsGenerator implements ContractsGenerator { private boolean checkConfig() { return config != null && classpathUrls != null; }  }
DefaultContractsGenerator implements ContractsGenerator { private boolean checkConfig() { return config != null && classpathUrls != null; }  @Override boolean canProcess(String type); @SuppressWarnings("unchecked") @Override void configure(Map<String, Object> config); @SuppressWarnings("ResultOfMethodCallIgnored") @Override void generate(); }
DefaultContractsGenerator implements ContractsGenerator { private boolean checkConfig() { return config != null && classpathUrls != null; }  @Override boolean canProcess(String type); @SuppressWarnings("unchecked") @Override void configure(Map<String, Object> config); @SuppressWarnings("ResultOfMethodCallIgnored") @Override void generate();  }