### Question:
ThemeExtractor implements Serializable { void updateThemeFromEngine(ThemeArchive themeArchive, final APISession apiSession, final File portalThemeDirectory, final File timestampFile, final long lastUpdateTimestamp, ThemeType themeType) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException, IOException { final Theme theme = getThemeAPI(apiSession).getCurrentTheme(themeType); themeArchive.setZippedTheme(theme.getContent()); final ThemeArchive.ThemeModifier themeModifier = themeArchive.extract(portalThemeDirectory); switch (themeType) { case PORTAL: extractPortalSpecificTheme(themeModifier, theme); break; case MOBILE: break; } writeTimeStampToFile(timestampFile, lastUpdateTimestamp); } ThemeExtractor(); void retrieveAndExtractCurrentTheme(File themeFolder, APISession apiSession, ThemeType themeType);  }### Answer:
@Test public void updateThemeFromEngine_should_retrieve_theme_from_Engine_and_compile() throws Exception { doReturn(mock(Theme.class)).when(themeAPI).getCurrentTheme(ThemeType.PORTAL); doReturn(themeModifier).when(themeArchive).extract(any(File.class)); doReturn(themeModifier).when(themeModifier).compile(CompilableFile.ALWAYS_COMPILED_FILES); doReturn(themeModifier).when(themeModifier).add(anyString(), any(byte[].class)); final File folder = tempFolderRule.newFolder(); final File lastUpdateFile = tempFolderRule.newFile(); themeExtractor.updateThemeFromEngine(themeArchive, session, folder, lastUpdateFile, new Date().getTime(), ThemeType.PORTAL); verify(themeAPI).getCurrentTheme(ThemeType.PORTAL); }