/** * This executor mainly translates the sources configuration provided by the pipeline input into an internal format * convenient for the local build system. * * @param localSourceConfig the local sources configuration. * * @return the internal representation of the sources in the local build system. */ @Override public Optional< Source > apply( LocalSourceConfig localSourceConfig ) { Path path = Paths.get( URI.create( localSourceConfig.getRootPath() ) ); return Optional.of( new LocalSource( path ) ); }
private void verifyLocalSourceConfigWasInvoked() { verify(localSourceConfigExecutor, times(1)).apply(localSourceConfigCaptor.capture()); assertEquals(ROOT_PATH_URI, localSourceConfigCaptor.getValue().getRootPath()); }
@Test public void testApply( ) { when( sourceConfig.getRootPath( ) ).thenReturn( ROOT_PATH_URI ); Optional< Source > result = executor.apply( sourceConfig ); assertTrue( result.isPresent( ) ); assertEquals( ROOT_PATH, result.get( ).getPath( ) ); } }