Tabnine Logo
JobConfig$Builder.build
Code IndexAdd Tabnine to your IDE (free)

How to use
build
method
in
de.otto.jlineup.config.JobConfig$Builder

Best Java code snippets using de.otto.jlineup.config.JobConfig$Builder.build (Showing top 20 results out of 315)

origin: otto-de/jlineup

@Before
public void setup() {
  initMocks(this);
  when(webDriverMock.manage()).thenReturn(webDriverOptionsMock);
  when(webDriverOptionsMock.timeouts()).thenReturn(webDriverTimeoutMock);
  when(webDriverOptionsMock.window()).thenReturn(webDriverWindowMock);
  when(webDriverOptionsMock.logs()).thenReturn(webDriverLogs);
  when(browserUtilsMock.getWebDriverByConfig(any(JobConfig.class), any(RunStepConfig.class))).thenReturn(webDriverMock);
  when(browserUtilsMock.getWebDriverByConfig(any(JobConfig.class), any(RunStepConfig.class), anyInt())).thenReturn(webDriverMock);
  when(webDriverMock.executeScript(JS_GET_USER_AGENT)).thenReturn("Mocked Webdriver");
  JobConfig jobConfig = configBuilder().build();
  testee = new Browser(runStepConfig, jobConfig, fileService, browserUtilsMock);
  testee.initializeWebDriver();
}
origin: de.otto/jlineup-core

public static JobConfig defaultConfig(String url) {
  return configBuilder().withUrls(ImmutableMap.of(url, new UrlConfig())).build();
}
origin: otto-de/jlineup

  private JobConfig createTestConfig() {
    return configBuilder()
        .withUrls(ImmutableMap.of("http://www.example.com",
            new UrlConfig(
                ImmutableList.of("/"),
                0,
                ImmutableList.of(),
                ImmutableMap.of(),
                ImmutableMap.of(),
                ImmutableMap.of(),
                ImmutableList.of(600),
                100000,
                0,
                0,
                0,
                DEFAULT_WARMUP_BROWSER_CACHE_TIME,
                null,
                0,
                new HttpCheckConfig(),
                0,
                false
            )))
        .build();
  }
}
origin: otto-de/jlineup

.withUrls(ImmutableMap.of("testurl", urlConfig))
.withWindowHeight(100)
.build();
origin: otto-de/jlineup

  private JobConfig createJobConfigWithUrlAndName(String url, String name) {
    return configBuilder()
        .withName(name)
        .withUrls(ImmutableMap.of(url,
            new UrlConfig(
                ImmutableList.of("/"),
                0,
                ImmutableList.of(),
                ImmutableMap.of(),
                ImmutableMap.of(),
                ImmutableMap.of(),
                ImmutableList.of(600),
                100000,
                0,
                0,
                0,
                DEFAULT_WARMUP_BROWSER_CACHE_TIME,
                null,
                0,
                new HttpCheckConfig(),
                0,
                false
            )))
        .build();

  }
}
origin: otto-de/jlineup

@Test
public void shouldSanitizeJobConfig() throws BrowserNotInstalledException {
  //Given
  JobConfig evilJobConfig = copyOfBuilder(exampleConfig())
      .withBrowser(CHROME_HEADLESS)
      .withThreads(Integer.MAX_VALUE)
      .withDebug(true)
      .withLogToFile(true)
      .withReportFormat(1)
      .build();
  //When
  JobConfig sanitizedJobConfig = jLineupRunnerFactory.sanitizeJobConfig(evilJobConfig);
  //Then
  assertThat(sanitizedJobConfig.threads, is(jLineupWebProperties.getMaxThreadsPerJob()));
  assertThat(sanitizedJobConfig.debug, is(false));
  assertThat(sanitizedJobConfig.logToFile, is(false));
  assertThat(sanitizedJobConfig.reportFormat, is(DEFAULT_REPORT_FORMAT));
}
origin: otto-de/jlineup

@Test
public void shouldReturn422IfConfigValidationFails() throws Exception {
  // given
  JobConfig jobConfig = JobConfig.copyOfBuilder(exampleConfig()).withUrls(null).build();
  when(jLineupService.startBeforeRun(jobConfig)).thenThrow(new ConfigValidationException("Validation message"));
  // when
  ResultActions result = mvc
      .perform(post("/runs")
          .content(JobConfig.prettyPrint(jobConfig))
          .contentType(MediaType.APPLICATION_JSON));
  // then
  result
      .andExpect(status().isUnprocessableEntity())
      .andExpect(content().string("\"Validation message\""));
}
origin: de.otto/jlineup-core

public static JobConfig exampleConfig() {
  return exampleConfigBuilder().build();
}
origin: otto-de/jlineup

private JobConfig localTestConfig(String endpoint, Browser.Type browser, boolean checkForErrors, UrlConfig urlConfig) {
  return JobConfig.configBuilder().withCheckForErrorsInLog(checkForErrors).withUrls(ImmutableMap.of("http://localhost:" + port + "/" + endpoint, urlConfig)).withBrowser(browser).build();
}
origin: otto-de/jlineup

@Test
public void shouldFailIfBrowserIsNotConfigured() {
  JobConfig jobConfig = copyOfBuilder(createTestConfig()).withBrowser(Browser.Type.FIREFOX).build();
  expectStatusCodeForConfig(jobConfig, UNPROCESSABLE_ENTITY.value());
}
origin: otto-de/jlineup

@Test
public void shouldGetPhantomJSDriver() {
  final JobConfig jobConfig = configBuilder().withBrowser(PHANTOMJS).build();
  assertSetDriverType(jobConfig, PhantomJSDriver.class);
}
origin: otto-de/jlineup

@Test
public void shouldGetChromeDriverForHeadlessChrome() {
  final JobConfig jobConfig = configBuilder().withBrowser(CHROME_HEADLESS).build();
  assertSetDriverType(jobConfig, ChromeDriver.class);
}
origin: otto-de/jlineup

  @Test
  public void shouldReduceNumberOfThreadsToMax() throws BrowserNotInstalledException {
    //Given
    JobConfig jobConfig = copyOfBuilder(exampleConfig())
        .withThreads(200)
        .build();
    //When
    JobConfig sanitizedConfig = jLineupRunnerFactory.sanitizeJobConfig(jobConfig);

    //Then
    assertThat(sanitizedConfig.threads, is(jLineupWebProperties.getMaxThreadsPerJob()));
  }
}
origin: otto-de/jlineup

@Test(expected = BrowserNotInstalledException.class)
public void shouldThrowBrowserNotInstalledException() throws BrowserNotInstalledException {
  // Given
  JobConfig jobConfig = copyOfBuilder(exampleConfig())
      .withBrowser(FIREFOX)
      .build();
  //When
  jLineupRunnerFactory.sanitizeJobConfig(jobConfig);
}
origin: otto-de/jlineup

@Before
public void setup() {
  initMocks(this);
  runConfig = RunStepConfig.jLineupRunConfigurationBuilder().withWorkingDirectory("src/test/resources").build();
  jobConfig = configBuilder()
      .withUrls(ImmutableMap.of(
          "http://url",
          new UrlConfig(ImmutableList.of("/"), 0.05f, null, null, null, null, ImmutableList.of(1001), 10000, 2, 0, 0, 0, null, 5, new HttpCheckConfig(),0, false)))
      .withWindowHeight(WINDOW_HEIGHT)
      .build();
  testee = new ScreenshotsComparator(runConfig, jobConfig, fileService, imageService);
}
origin: otto-de/jlineup

@Test
public void shouldGetFirefoxDriver() {
  final JobConfig jobConfig = configBuilder().withBrowser(FIREFOX).build();
  assertSetDriverType(jobConfig, FirefoxDriver.class);
}
origin: otto-de/jlineup

@Test
public void shouldUseDefinedNumberOfThreadsIfConfiguredAndBelowMax() throws BrowserNotInstalledException {
  //Given
  JobConfig jobConfig = copyOfBuilder(exampleConfig())
      .withThreads(2)
      .build();
  //When
  JobConfig sanitizedConfig = jLineupRunnerFactory.sanitizeJobConfig(jobConfig);
  //Then
  assertThat(sanitizedConfig.threads, is(2));
}
origin: otto-de/jlineup

  @Test
  public void shouldNotCheckForErrorsIfDisabled() {
    //given
    when(webDriver.manage().logs().get(LogType.BROWSER)).thenReturn(new LogEntries(of(new LogEntry(Level.SEVERE, Instant.now().toEpochMilli(), "Fehler!"))));
    JobConfig jobConfig = JobConfig.exampleConfigBuilder().withCheckForErrorsInLog(false).build();

    //when
    new LogErrorChecker().checkForErrors(webDriver, jobConfig);

    //then expect no exception

  }
}
origin: otto-de/jlineup

@Test
public void shouldUseMaxThreadsPerJobIfNoThreadsAreConfigured() throws BrowserNotInstalledException {
  //Given
  JobConfig jobConfig = copyOfBuilder(exampleConfig())
      .withThreads(0)
      .build();
  //When
  JobConfig sanitizedConfig = jLineupRunnerFactory.sanitizeJobConfig(jobConfig);
  //Then
  assertThat(sanitizedConfig.threads, is(jLineupWebProperties.getMaxThreadsPerJob()));
}
origin: otto-de/jlineup

@Test
public void shouldGetChromeDriver() {
  final JobConfig jobConfig = configBuilder().withBrowser(CHROME).build();
  assertSetDriverType(jobConfig, ChromeDriver.class);
}
de.otto.jlineup.configJobConfig$Builderbuild

Popular methods of JobConfig$Builder

  • withBrowser
  • withUrls
  • withCheckForErrorsInLog
  • withDebug
  • withLogToFile
  • withName
  • withReportFormat
  • withThreads
  • withWindowHeight
  • <init>
  • withGlobalTimeout
  • withGlobalWaitAfterPageLoad
  • withGlobalTimeout,
  • withGlobalWaitAfterPageLoad,
  • withHttpCheck,
  • withPageLoadTimeout,
  • withScreenshotRetries

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setScale (BigDecimal)
  • getSharedPreferences (Context)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now