### Question:
ConfigMapHelper { public static Step createScriptConfigMapStep(String operatorNamespace, String domainNamespace) { return new ScriptConfigMapStep(operatorNamespace, domainNamespace); } private  ConfigMapHelper(); static Step createScriptConfigMapStep(String operatorNamespace, String domainNamespace); static int getModelInImageSpecHash(String imageName); static String getIntrospectorConfigMapName(String domainUid); static Step createIntrospectorConfigMapStep(Step next); static Step reportTopologyErrorsAndStop(); static Step deleteIntrospectorConfigMapStep(String domainUid, String namespace, Step next); static Step readExistingIntrospectorConfigMap(String ns, String domainUid); static Step readIntrospectionVersionStep(String ns, String domainUid);  }### Answer:
@Test public void whenUnableToReadConfigMap_reportFailure() { testSupport.failOnResource(CONFIG_MAP, SCRIPT_CONFIG_MAP_NAME, DOMAIN_NS, 401); Step scriptConfigMapStep = ConfigMapHelper.createScriptConfigMapStep(OPERATOR_NS, DOMAIN_NS); testSupport.runSteps(scriptConfigMapStep); testSupport.verifyCompletionThrowable(FailureStatusSourceException.class); }
@Test public void whenNoConfigMap_createIt() { testSupport.runSteps(ConfigMapHelper.createScriptConfigMapStep(OPERATOR_NS, DOMAIN_NS)); assertThat(testSupport.getResources(CONFIG_MAP), notNullValue()); assertThat(logRecords, containsInfo(CM_CREATED)); }
@Test public void whenNoConfigMap_retryOnFailure() { testSupport.addRetryStrategy(retryStrategy); testSupport.failOnCreate(CONFIG_MAP, SCRIPT_CONFIG_MAP_NAME, DOMAIN_NS, 401); Step scriptConfigMapStep = ConfigMapHelper.createScriptConfigMapStep(OPERATOR_NS, DOMAIN_NS); testSupport.runSteps(scriptConfigMapStep); testSupport.verifyCompletionThrowable(FailureStatusSourceException.class); assertThat(retryStrategy.getConflictStep(), sameInstance(scriptConfigMapStep)); }
@Test public void whenMatchingConfigMapExists_addToPacket() { testSupport.defineResources(defaultConfigMap); Packet packet = testSupport.runSteps(ConfigMapHelper.createScriptConfigMapStep(OPERATOR_NS, DOMAIN_NS)); assertThat(logRecords, containsFine(CM_EXISTS)); assertThat(packet, hasEntry(SCRIPT_CONFIG_MAP, defaultConfigMap)); }
@Test public void whenExistingConfigMapIsMissingData_replaceIt() { testSupport.defineResources(defineConfigMap(PARTIAL_SCRIPT_NAMES)); testSupport.runSteps(ConfigMapHelper.createScriptConfigMapStep(OPERATOR_NS, DOMAIN_NS)); assertThat(logRecords, containsInfo(CM_REPLACED)); assertThat(getScriptConfigKeys(), containsInAnyOrder(COMBINED_SCRIPT_NAMES)); }
@Test public void whenExistingConfigMapHasExtraData_dontRemoveIt() { testSupport.defineResources(defineConfigMap(PARTIAL_SCRIPT_NAMES)); testSupport.runSteps(ConfigMapHelper.createScriptConfigMapStep(OPERATOR_NS, DOMAIN_NS)); assertThat(logRecords, containsInfo(CM_REPLACED)); assertThat(getScriptConfigKeys(), hasItem(ADDITIONAL_NAME)); }