### Question:
MockedAdapterSetupService { public <A extends AdapterContext<C>, C extends AdapterConfig> MockedAdapterSetupEntry getSetupFor(AbstractMockedAdapter<A, C> adapter, C config) { boolean configuredResult = config.getOptions().get(AdapterOptionKey.MOCK_CONFIGURATION_RESULT)!=null; if (configuredResult) { return createDynamicResultByAdapter(adapter,config); } return createStaticResultByTargets(adapter); }  MockedAdapterSetupEntry getSetupFor(AbstractMockedAdapter<A, C> adapter, C config); static final String DEFAULT_FILE_PATH; }### Answer:
@SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void static_read_default_setup_possible_and_has_atleast_checkmarx_and_netsparker_data_for_ANY_OTHER_TARGET_inside() { File gradleSafeTestFile = SecHubAdapterTestFileSupport.INSTANCE .createFileFromResourcePath(MockedAdapterSetupService.DEFAULT_FILE_PATH); serviceToTest.filePath = gradleSafeTestFile.getAbsolutePath(); AbstractMockedAdapter mockedCheckmarxAdapter = mock(AbstractMockedAdapter.class); AbstractMockedAdapter mockedNetsparkerAdapter = mock(AbstractMockedAdapter.class); AbstractAdapterConfig config = mock(AbstractAdapterConfig.class); when(mockedCheckmarxAdapter.createAdapterId()).thenReturn("MockedNessusAdapter"); when(mockedNetsparkerAdapter.createAdapterId()).thenReturn("MockedNetsparkerAdapter"); MockedAdapterSetupEntry checkmarxSetup = serviceToTest.getSetupFor(mockedCheckmarxAdapter,config); MockedAdapterSetupEntry netsparkerSetup = serviceToTest.getSetupFor(mockedNetsparkerAdapter,config); assertNotNull(checkmarxSetup); assertNotNull(checkmarxSetup.getCombination(MockedAdapterSetupCombination.ANY_OTHER_TARGET)); assertNotNull(netsparkerSetup); assertNotNull(netsparkerSetup.getCombination(MockedAdapterSetupCombination.ANY_OTHER_TARGET)); }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void dynamic_when_config_has_option_set_expected_dynamic_setup_combination_is_returned() { AbstractMockedAdapter mockedCheckmarxAdapter = mock(AbstractMockedAdapter.class); AbstractAdapterConfig config = mock(AbstractAdapterConfig.class); when(mockedCheckmarxAdapter.createAdapterId()).thenReturn("MockedNessusAdapter"); Map<AdapterOptionKey, String> options = new HashMap<>(); options.put(AdapterOptionKey.MOCK_CONFIGURATION_RESULT, "yellow"); when(config.getOptions()).thenReturn(options); when(config.getTargetAsString()).thenReturn("target1"); when(mockedCheckmarxAdapter.getPathToMockResultFile("yellow")).thenReturn("pathFromAdapter"); MockedAdapterSetupEntry checkmarxSetup = serviceToTest.getSetupFor(mockedCheckmarxAdapter,config); assertNotNull(checkmarxSetup); MockedAdapterSetupCombination combination = checkmarxSetup.getCombination("target1"); assertNotNull(combination); assertEquals("target1",combination.getTarget()); assertEquals("Filepath differs","pathFromAdapter",combination.getFilePath()); assertFalse(combination.isThrowsAdapterException()); assertEquals(1000L, combination.getTimeToElapseInMilliseconds()); }