### Question:
DefaultApplicationActionFactory implements ApplicationActionFactory { @Override public ApplicationAction create(Map<String, String> testCaseStep, int i) { String name = testCaseStep.get(EVENT); ApplicationActionConfiguration applicationActionConfiguration = nameToConfiguration.get(name); return testCaseStepToApplicationActionConverter.convert(applicationActionConfiguration, testCaseStep, i); } DefaultApplicationActionFactory(ApplicationConfiguration applicationConfiguration,
                                           TestCaseStepToApplicationActionConverter testCaseStepToApplicationActionConverter); @Override ApplicationAction create(Map<String, String> testCaseStep, int i);  }### Answer:
@Test public void canCreatePageLoadingAndOtherActions() { String url = "http: String actionName = "actionName"; ApplicationActionConfiguration applicationActionConfiguration = mock(ApplicationActionConfiguration.class); when(applicationActionConfiguration.getName()).thenReturn(actionName); List<ApplicationActionConfiguration> applicationActionConfigurationList = new ArrayList<>(); applicationActionConfigurationList.add(applicationActionConfiguration); ApplicationConfiguration applicationConfiguration = mock(ApplicationConfiguration.class); when(applicationConfiguration.getApplicationActionConfigurationList()).thenReturn(applicationActionConfigurationList); TestCaseStepToApplicationActionConverter testCaseStepToApplicationActionConverter = mock(TestCaseStepToApplicationActionConverter.class); ApplicationAction applicationAction = mock(ApplicationAction.class); Map<String, String> testCaseStep = new HashMap<>(); testCaseStep.put("event", actionName); int i = 0; when(testCaseStepToApplicationActionConverter.convert(applicationActionConfiguration, testCaseStep, i)) .thenReturn(applicationAction); ApplicationActionFactory applicationActionFactory = new DefaultApplicationActionFactory(applicationConfiguration, testCaseStepToApplicationActionConverter); assertEquals(applicationAction, applicationActionFactory.create(testCaseStep, i)); }