@Test
public void testPublishFolderPaths() throws IOException {

  AgentProviderService aps = createAgentProviderService(new Configuration());
  StateAccessForProviders access = createNiceMock(StateAccessForProviders.class);
  AgentProviderService mockAps = Mockito.spy(aps);
  doReturn(access).when(mockAps).getAmState();
  PublishedExportsSet pubExpSet = new PublishedExportsSet();
  expect(access.getPublishedExportsSet()).andReturn(pubExpSet).anyTimes();
  replay(access);
  Map<String, String> folders = new HashMap<String, String>();
  folders.put("AGENT_LOG_ROOT", "aFolder");
  folders.put("AGENT_WORK_ROOT", "folderB");
  mockAps.publishFolderPaths(folders, "cid", "role", "fqdn");
  PublishedExports exports = pubExpSet.get("container_log_dirs");
  Assert.assertEquals(1, exports.entries.size());
  List<ExportEntry> expEntries = exports.entries.get("role");
  Assert.assertEquals(1, expEntries.size());
  Assert.assertEquals("cid", expEntries.get(0).getContainerId());
  Assert.assertEquals("component", expEntries.get(0).getLevel());
  Assert.assertEquals("role", expEntries.get(0).getTag());
  Assert.assertEquals("fqdn:aFolder", expEntries.get(0).getValue());
  Assert.assertNull(expEntries.get(0).getValidUntil());
  Assert.assertEquals(null, expEntries.get(0).getValidUntil());
  exports = pubExpSet.get("container_work_dirs");
  Assert.assertEquals(1, exports.entries.size());
  expEntries = exports.entries.get("role");
  Assert.assertEquals(1, expEntries.size());
  Assert.assertEquals("cid", expEntries.get(0).getContainerId());
  Assert.assertEquals("component", expEntries.get(0).getLevel());
  Assert.assertEquals("role", expEntries.get(0).getTag());
  Assert.assertEquals("fqdn:folderB", expEntries.get(0).getValue());
  Assert.assertNull(expEntries.get(0).getValidUntil());
  Assert.assertEquals(null, expEntries.get(0).getValidUntil());
}