void assertAllRunningTasksMatch(final String environmentName, final String taskDefinition) throws InterruptedException { waitOrTimeout( RECONCILIATION_INTERVAL * 3 / 2, () -> assertThat(stack.describeTasks()) .as("Tasks launched by blox") .allSatisfy( t -> assertThat(t) .hasFieldOrPropertyWithValue("group", environmentName) .hasFieldOrPropertyWithValue("taskDefinitionArn", taskDefinition))); } }
@Test public void doesNothingIfNoEnvironmentRevisionIsActive() throws Exception { DescribeEnvironmentRequest describeEnvironmentRequest = DescribeEnvironmentRequest.builder().environmentId(environmentId).build(); when(dataService.describeEnvironment(describeEnvironmentRequest)) .thenReturn( DescribeEnvironmentResponse.builder() .environment(environmentWithActiveRevision(null)) .build()); SchedulerHandler handler = new SchedulerHandler(dataService, ecs, schedulerFactory); SchedulerOutput output = handler.handleRequest(new SchedulerInput(EMPTY_CLUSTER, environmentId), null); verify(dataService, never()).describeEnvironmentRevision(any()); assertThat(output) .hasFieldOrPropertyWithValue("failedActions", 0L) .hasFieldOrPropertyWithValue("successfulActions", 0L); }
.isEqualToIgnoringGivenFields(environment, "environmentName", "cluster", "environmentType"); assertThat(response.getEnvironment()) .hasFieldOrPropertyWithValue("cluster", id.getCluster()) .hasFieldOrPropertyWithValue("environmentName", id.getEnvironmentName()) .hasFieldOrPropertyWithValue("environmentType", ENVIRONMENT_TYPE_STRING);
.isEqualToIgnoringGivenFields(environment, "environmentName", "cluster", "environmentType"); assertThat(response.getEnvironment()) .hasFieldOrPropertyWithValue("cluster", id.getCluster()) .hasFieldOrPropertyWithValue("environmentName", id.getEnvironmentName()) .hasFieldOrPropertyWithValue("environmentType", ENVIRONMENT_TYPE_STRING);
kieSession.dispose(); checkList(seed, list); Assertions.assertThat(bean).hasFieldOrPropertyWithValue("seed", 0);
Assertions.assertThat(bean).hasFieldOrPropertyWithValue("seed", 0);
@Override ProxyHTTP buildProxy(final JGitFileSystemProviderConfiguration config) { ProxyHTTP proxy = super.buildProxy(config); assertThat(proxy).hasFieldOrPropertyWithValue("proxy_host", "somehost"); assertThat(proxy).hasFieldOrPropertyWithValue("proxy_port", 10); assertThat(proxy).hasFieldOrPropertyWithValue("user", "user"); assertThat(proxy).hasFieldOrPropertyWithValue("passwd", "passwd"); return proxy; } };
@Override ProxyHTTP buildProxy(final JGitFileSystemProviderConfiguration config) { ProxyHTTP proxy = super.buildProxy(config); assertThat(proxy).hasFieldOrPropertyWithValue("proxy_host", "somehost"); assertThat(proxy).hasFieldOrPropertyWithValue("proxy_port", 10); assertThat(proxy).hasFieldOrPropertyWithValue("user", "user"); assertThat(proxy).hasFieldOrPropertyWithValue("passwd", "passwd"); return proxy; } };
@Override ProxyHTTP buildProxy(final JGitFileSystemProviderConfiguration config) { ProxyHTTP proxy = super.buildProxy(config); assertThat(proxy).hasFieldOrPropertyWithValue("proxy_host", "somehost"); assertThat(proxy).hasFieldOrPropertyWithValue("proxy_port", 10); assertThat(proxy).hasFieldOrPropertyWithValue("user", "user"); assertThat(proxy).hasFieldOrPropertyWithValue("passwd", "passwd"); return proxy; } };
protected void checkDecoratorRow(LayoutRow row) { LayoutComponent component = checkRow(row); Assertions.assertThat(component) .isNotNull() .hasFieldOrPropertyWithValue("dragTypeName", FormsMigrationConstants.HTML_COMPONENT); }
private void verifyModel(ProcessableModel model, Date date) { Assertions.assertThat(model) .isNotNull() .hasFieldOrPropertyWithValue(BIG_DECIMAL, new BigDecimal("0.2")) .hasFieldOrPropertyWithValue(A_FLOAT, Float.valueOf("0.2")) .hasFieldOrPropertyWithValue(BIG_INTEGER, new BigInteger("2")) .hasFieldOrPropertyWithValue(LOCAL_DATE, new LocalDateConverter().toRawValue(date)) .hasFieldOrPropertyWithValue(LOCAL_DATE_TIME, new LocalDateTimeConverter().toRawValue(date)) .hasFieldOrPropertyWithValue(LOCAL_TIME, new LocalTimeConverter().toRawValue(date)) .hasFieldOrPropertyWithValue(OFFSET_DATE_TIME, new OffsetDateTimeConverter().toRawValue(date)); }
private void testPostCommit(final Integer exitCode) throws IOException { prepareHook(exitCode); commitFile(); verify(postCommitHook).execute(contextCaptor.capture()); FileSystemHookExecutionContext context = contextCaptor.getValue(); Assertions.assertThat(context) .isNotNull() .hasFieldOrPropertyWithValue("fsName", REPO_NAME); Assertions.assertThat(context.getParamValue(FileSystemHooksConstants.POST_COMMIT_EXIT_CODE)) .isNotNull() .isEqualTo(exitCode); }
private void testPostCommit(final Integer exitCode) throws IOException { prepareHook(exitCode); commitFile(); verify(postCommitHook).execute(contextCaptor.capture()); FileSystemHookExecutionContext context = contextCaptor.getValue(); Assertions.assertThat(context) .isNotNull() .hasFieldOrPropertyWithValue("fsName", REPO_NAME); Assertions.assertThat(context.getParamValue(FileSystemHooksConstants.POST_COMMIT_EXIT_CODE)) .isNotNull() .isEqualTo(exitCode); }
@Test public void apiVersionBeansAreCreatedWithDefault() { webApplicationContextRunner() .withUserConfiguration(ServicesConfiguration.class) .run((context) -> { assertThat(context).getBean(BrokerApiVersion.class) .hasFieldOrPropertyWithValue("apiVersion", API_VERSION_ANY); assertThat(context).hasSingleBean(ApiVersionInterceptor.class); assertThat(context).hasSingleBean(ApiVersionWebMvcConfigurerAdapter.class); }); }
@Test public void apiVersionBeansAreCreatedFromCustomVersionBean() { webApplicationContextRunner() .withUserConfiguration(ServicesConfiguration.class, CustomBrokerApiVersionConfigurationFromBean.class) .run((context) -> { assertThat(context).getBean(BrokerApiVersion.class) .hasFieldOrPropertyWithValue("apiVersion", API_VERSION_CURRENT); assertThat(context).hasSingleBean(ApiVersionInterceptor.class); assertThat(context).hasSingleBean(ApiVersionWebMvcConfigurerAdapter.class); }); }
@Test public void apiVersionBeansAreCreatedFromCustomVersionBeanOverridesProperty() { webApplicationContextRunner() .withUserConfiguration(ServicesConfiguration.class, CustomBrokerApiVersionConfigurationFromBeanAndProperty.class) .run((context) -> { assertThat(context).getBean(BrokerApiVersion.class) .hasFieldOrPropertyWithValue("apiVersion", "99.999"); assertThat(context).hasSingleBean(ApiVersionInterceptor.class); assertThat(context).hasSingleBean(ApiVersionWebMvcConfigurerAdapter.class); }); }
@Test public void apiVersionBeansAreCreatedFromCustomVersionProperty() { webApplicationContextRunner() .withUserConfiguration(ServicesConfiguration.class, CustomBrokerApiVersionConfigurationFromProperty.class) .run((context) -> { assertThat(context).getBean(BrokerApiVersion.class) .hasFieldOrPropertyWithValue("apiVersion", "42.321"); assertThat(context).hasSingleBean(ApiVersionInterceptor.class); assertThat(context).hasSingleBean(ApiVersionWebMvcConfigurerAdapter.class); }); }
@Test public void apiVersionBeansAreCreatedFromCustomVersionBeanOverridesProperty() { webApplicationContextRunner() .withUserConfiguration(ServicesConfiguration.class, CustomBrokerApiVersionConfigurationFromBeanAndProperty.class) .run((context) -> { assertThat(context).getBean(BrokerApiVersion.class) .hasFieldOrPropertyWithValue("apiVersion", "99.999"); assertThat(context).hasSingleBean(ApiVersionWebFilter.class); }); }
@Test public void apiVersionBeansAreCreatedWithDefault() { webApplicationContextRunner() .withUserConfiguration(ServicesConfiguration.class) .run((context) -> { assertThat(context).getBean(BrokerApiVersion.class) .hasFieldOrPropertyWithValue("apiVersion", API_VERSION_ANY); assertThat(context).hasSingleBean(ApiVersionWebFilter.class); }); }
@Test public void apiVersionBeansAreCreatedFromCustomVersionProperty() { webApplicationContextRunner() .withUserConfiguration(ServicesConfiguration.class, CustomBrokerApiVersionConfigurationFromProperty.class) .run((context) -> { assertThat(context).getBean(BrokerApiVersion.class) .hasFieldOrPropertyWithValue("apiVersion", "42.321"); assertThat(context).hasSingleBean(ApiVersionWebFilter.class); }); }