### Question:
YarnResourceManagerRoleConfigProvider extends AbstractRoleConfigProvider { @Override public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { return cmTemplateProcessor.getServiceByType(HiveRoles.HIVELLAP).isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()); }  @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source);  }### Answer:
@Test public void testIsConfigurableWhenLlapIsPresent() { when(cmTemplateProcessor.getServiceByType(eq(HiveRoles.HIVELLAP))).thenReturn(Optional.of(new ApiClusterTemplateService())); when(cmTemplateProcessor.isRoleTypePresentInService(anyString(), anyList())).thenReturn(true); assertTrue(underTest.isConfigurationNeeded(cmTemplateProcessor, null)); }
@Test public void testIsConfigurableWhenLlapIsNotPresent() { when(cmTemplateProcessor.getServiceByType(eq(HiveRoles.HIVELLAP))).thenReturn(Optional.empty()); assertFalse(underTest.isConfigurationNeeded(cmTemplateProcessor, null)); }