GoValueProviderFactory implements ValueProviderFactory { @Override public ValueProvider newInstance(FolderEntry projectFolder) { return new GoValueProvider(projectFolder); }  @Override ValueProvider newInstance(FolderEntry projectFolder); static final String GO_EXTESION; }
@Test public void testGetValuesWhenProjectContainsGoFiles() throws Exception { Project goProject = pm.createProject(workspace, "goProject", new ProjectConfig("test project", "go", new HashMap<>(), null, null, null), null, null); FolderEntry baseFolder = goProject.getBaseFolder(); baseFolder.createFile("test.go", "test".getBytes(), MediaType.TEXT_PLAIN); List<String> values = goValueProviderFactory.newInstance(baseFolder).getValues(HAS_GO_FILES); Assert.assertNotNull(values); Assert.assertFalse(values.isEmpty()); assertEquals(1, values.size()); }
@Test public void testGetValuesWhenProjectNotContainsGoFiles() throws Exception { Project goProject = pm.createProject(workspace, "goProject", new ProjectConfig("test project", "go", new HashMap<>(), null, null, null), null, null); FolderEntry baseFolder = goProject.getBaseFolder(); FolderEntry firstFolder = baseFolder.createFolder("firstFolder"); FolderEntry secondFolder = baseFolder.createFolder("secondFolder"); firstFolder.createFile("test.txt", "test".getBytes(), MediaType.TEXT_PLAIN); secondFolder.createFile("test.java", "test".getBytes(), MediaType.TEXT_PLAIN); List<String> values = goValueProviderFactory.newInstance(baseFolder).getValues(HAS_GO_FILES); Assert.assertNotNull(values); Assert.assertTrue(values.isEmpty()); }