### Question:
ModuleDeterminer { public Module determineModuleToDeploy() { Module moduleToDeploy = getContext().getVariable(Variables.MODULE_TO_DEPLOY); return moduleToDeploy != null ? moduleToDeploy : determineModule(); }  Module determineModuleToDeploy(); abstract MtaMetadataParser getMtaMetadataParser(); abstract ProcessContext getContext();  }### Answer:
@Test void testDetermineModuleToDeployModuleIsSet() { ModuleDeterminer moduleDeterminer = createModuleDeterminer(); context.setVariable(Variables.MODULE_TO_DEPLOY, createModule("test-module")); Module module = moduleDeterminer.determineModuleToDeploy(); Assertions.assertEquals("test-module", module.getName()); }
@Test void testDetermineModuleIfModuleIsNotSetAnywhere() { ModuleDeterminer moduleDeterminer = createModuleDeterminer(); Assertions.assertNull(moduleDeterminer.determineModuleToDeploy()); }
@Test void testDetermineModuleIfModuleIsNotSet() { ModuleDeterminer moduleDeterminer = createModuleDeterminer(); DeploymentDescriptor completeDeploymentDescriptor = createDeploymentDescriptor(); Module moduleToDeploy = createModule("some-module-name"); completeDeploymentDescriptor.setModules(List.of(moduleToDeploy)); context.setVariable(Variables.COMPLETE_DEPLOYMENT_DESCRIPTOR, completeDeploymentDescriptor); context.setVariable(Variables.APP_TO_PROCESS, createApplication("app-to-process", "some-module-name", null)); context.setVariable(Variables.MTA_MAJOR_SCHEMA_VERSION, 3); Module module = moduleDeterminer.determineModuleToDeploy(); Assertions.assertEquals("some-module-name", module.getName()); }