use of java.util.stream.IntStream in project kie-wb-common by kiegroup.
the class AbstractFormDefinitionGeneratorTest method verifyUserForm.
protected void verifyUserForm(FormMigrationSummary summary) {
Form originalForm = summary.getOriginalForm().get();
Assertions.assertThat(originalForm.getFormFields()).isNotEmpty().hasSize(2);
FormDefinition newForm = summary.getNewForm().get();
Assertions.assertThat(newForm.getFields()).isNotEmpty().hasSize(2);
Assertions.assertThat(newForm.getModel()).isNotNull().hasFieldOrPropertyWithValue("className", USER_MODEL).isInstanceOf(DataObjectFormModel.class);
IntStream indexStream = IntStream.range(0, newForm.getFields().size());
LayoutTemplate formLayout = newForm.getLayoutTemplate();
assertNotNull(formLayout);
Assertions.assertThat(formLayout.getRows()).isNotEmpty().hasSize(2);
indexStream.forEach(index -> {
FieldDefinition fieldDefinition = newForm.getFields().get(index);
switch(index) {
case 0:
checkFieldDefinition(fieldDefinition, USER_LOGIN, "login", "login", TextBoxFieldDefinition.class, newForm, originalForm.getField(fieldDefinition.getName()));
break;
case 1:
checkFieldDefinition(fieldDefinition, USER_PASSWORD, "password", "password", TextBoxFieldDefinition.class, newForm, originalForm.getField(fieldDefinition.getName()));
break;
}
LayoutRow fieldRow = formLayout.getRows().get(index);
assertNotNull(fieldRow);
Assertions.assertThat(fieldRow.getLayoutColumns()).isNotEmpty().hasSize(1);
LayoutColumn fieldColumn = fieldRow.getLayoutColumns().get(0);
assertNotNull(fieldColumn);
assertEquals("12", fieldColumn.getSpan());
Assertions.assertThat(fieldColumn.getLayoutComponents()).isNotEmpty().hasSize(1);
checkLayoutFormField(fieldColumn.getLayoutComponents().get(0), fieldDefinition, newForm);
});
}
use of java.util.stream.IntStream in project assertj-core by joel-costigliola.
the class Assertions_assertThat_with_IntStream_Test method isInstanceOfAny_should_check_the_original_stream_without_consuming_it.
@Test
public void isInstanceOfAny_should_check_the_original_stream_without_consuming_it() {
IntStream stream = mock(IntStream.class);
assertThat(stream).isInstanceOfAny(IntStream.class, String.class);
verifyZeroInteractions(stream);
}
use of java.util.stream.IntStream in project assertj-core by joel-costigliola.
the class Assertions_assertThat_with_IntStream_Test method isInstanceOf_should_check_the_original_stream_without_consuming_it.
@Test
public void isInstanceOf_should_check_the_original_stream_without_consuming_it() {
IntStream stream = mock(IntStream.class);
assertThat(stream).isInstanceOf(IntStream.class);
verifyZeroInteractions(stream);
}
use of java.util.stream.IntStream in project assertj-core by joel-costigliola.
the class Assertions_assertThat_with_IntStream_Test method should_not_consume_stream_when_asserting_non_null.
@Test
public void should_not_consume_stream_when_asserting_non_null() {
IntStream stream = mock(IntStream.class);
assertThat(stream).isNotNull();
verifyZeroInteractions(stream);
}
use of java.util.stream.IntStream in project assertj-core by joel-costigliola.
the class Assertions_assertThat_with_IntStream_Test method isSameAs_should_check_the_original_stream_without_consuming_it.
@Test
public void isSameAs_should_check_the_original_stream_without_consuming_it() {
IntStream stream = mock(IntStream.class);
assertThat(stream).isSameAs(stream);
verifyZeroInteractions(stream);
}
Aggregations