@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)); }
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); }
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); } }
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); }  }
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); }
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; }