PathExtensionFileNameFormat implements FileNameFormat { @Override public String getPath() { return delegate.getPath() + "/" + pathExtension; } PathExtensionFileNameFormat(String pathExtension, FileNameFormat delegate); @Override void prepare(Map map, TopologyContext topologyContext); @Override String getName(long rotation, long l1); @Override String getPath();  }
@Test public void testGetPath() { FileNameFormat delegate = new DefaultFileNameFormat().withExtension(EXTENSION).withPath(PATH); FileNameFormat sourceFormat = new PathExtensionFileNameFormat(PATH_EXTENSION, delegate); String actual = sourceFormat.getPath(); String expected = PATH + "/" + PATH_EXTENSION; assertEquals(expected, actual); }
@Test public void testGetPathEmptyPathExtension() { FileNameFormat delegate = new DefaultFileNameFormat().withExtension(EXTENSION).withPath(PATH); FileNameFormat sourceFormat = new PathExtensionFileNameFormat("", delegate); String actual = sourceFormat.getPath(); assertEquals(PATH + "/", actual); }