### Question:
BuildConfiguration implements Serializable { public ArchiveCompression getCompression() { return compression; } BuildConfiguration(); boolean isDockerFileMode(); File getDockerFile(); File getDockerArchive(); File getContextDir(); String getFilter(); String getDockerFileRaw(); String getContextDirRaw(); Arguments getShell(); String getDockerArchiveRaw(); String getDockerFileDirRaw(); String getFilterRaw(); String getFrom(); Map<String, String> getFromExt(); String getRegistry(); String getMaintainer(); String getWorkdir(); AssemblyConfiguration getAssemblyConfiguration(); List<String> getPorts(); String getImagePullPolicy(); List<String> getVolumes(); List<String> getTags(); Map<String, String> getEnv(); Map<String, String> getLabels(); Arguments getCmd(); String getCleanupMode(); Boolean getNoCache(); Boolean getOptimise(); Boolean getSkip(); ArchiveCompression getCompression(); Map<String, String> getBuildOptions(); Arguments getEntryPoint(); List<String> getRunCmds(); String getUser(); HealthCheckConfiguration getHealthCheck(); Map<String, String> getArgs(); boolean optimise(); @Deprecated String getCommand(); String getCleanup(); boolean nocache(); CleanupMode cleanupMode(); File getAbsoluteContextDirPath(String sourceDirectory, String projectBaseDir); File getAbsoluteDockerFilePath(String sourceDirectory, String projectBaseDir); File getAbsoluteDockerTarPath(String sourceDirectory, String projectBaseDir); String initAndValidate(KitLogger log); String validate(); File calculateDockerFilePath(); static final String DEFAULT_FILTER; static final String DEFAULT_CLEANUP; }### Answer:
@Test public void compression() { BuildConfiguration config = new BuildConfiguration.Builder(). compression("gzip").build(); assertEquals(gzip, config.getCompression()); config = new BuildConfiguration.Builder().build(); assertEquals(none, config.getCompression()); config = new BuildConfiguration.Builder(). compression("bzip2").build(); assertEquals(bzip2, config.getCompression()); try { new BuildConfiguration.Builder(). compression("bzip").build(); fail(); } catch (Exception exp) { assertTrue(exp.getMessage().contains("bzip")); } }