src/test/java/org/embulk/decoder/TestCommonsCompressDecoderPlugin.java in embulk-decoder-commons-compress-0.3.2 vs src/test/java/org/embulk/decoder/TestCommonsCompressDecoderPlugin.java in embulk-decoder-commons-compress-0.3.3

- old
+ new

@@ -58,10 +58,20 @@ Assert.assertEquals("Verify the config name.", "format", config.value()); Assert.assertEquals("Verify the default config value.", DEFAULT_FORMAT_CONFIG, configDefault.value()); } @Test + public void testPluginTaskGetDecompressConcatenated() throws Exception { + Method method = CommonsCompressDecoderPlugin.PluginTask.class.getMethod("getDecompressConcatenated"); + Config config = method.getAnnotation(Config.class); + ConfigDefault configDefault = method.getAnnotation(ConfigDefault.class); + + Assert.assertEquals("Verify the config name.", "decompress_concatenated", config.value()); + Assert.assertEquals("Verify the default config value.", "true", configDefault.value()); + } + + @Test public void testTransaction(@Mocked final ConfigSource config, @Mocked final DecoderPlugin.Control control) { new NonStrictExpectations() {{ config.loadConfig(CommonsCompressDecoderPlugin.PluginTask.class); result = task; task.dump(); result = taskSource; @@ -550,13 +560,15 @@ } private class MockPluginTask implements CommonsCompressDecoderPlugin.PluginTask { private final String format; + private final boolean decompressConcatenated; MockPluginTask(String format) { this.format = format; + this.decompressConcatenated = true; } @Override public TaskSource dump() { return null; @@ -567,9 +579,14 @@ } @Override public String getFormat() { return format; + } + + @Override + public boolean getDecompressConcatenated() { + return decompressConcatenated; } @Override public BufferAllocator getBufferAllocator() { return newBufferAllocator();