@Test public void test_attributes() { ProtobufSystemInfo.Section section = underTest.toProtobuf(); assertThat(attribute(section, "Nodes").getLongValue()).isGreaterThan(0); assertThat(attribute(section, "State").getStringValue()).isIn("RED", "YELLOW", "GREEN"); } }
variableValues.add(var.getValue()); variableIds.add(var.getVariableId()); Assertions.assertThat(var.getOldValue()).isIn("", " ", null); Assertions.assertThat(var.getProcessInstanceId().longValue()).isEqualTo(processInstance.getId()); Assertions.assertThat(var.getProcessId()).isEqualTo(processInstance.getProcessId());
Assertions.assertThat(var.getOldValue()).isIn("", " ", null); Assertions.assertThat(var.getProcessInstanceId().longValue()).isEqualTo(processInstance.getId()); Assertions.assertThat(var.getProcessId()).isEqualTo(processInstance.getProcessId());
variableIds.add(var.getVariableId()); Assertions.assertThat(var.getOldValue()).isIn("", " ", null); Assertions.assertThat(var.getProcessInstanceId()).isEqualTo(processInstance.getProcessInstanceId()); Assertions.assertThat(var.getProcessId()).isEqualTo(processInstance.getProcessId());
@Test public void getAllBenchmarks_activeVariables_with_regex() throws IOException { withActiveVariables("format=(.rc)|(tx.)"); assertLoadedBenchmarksCount(4).forEach(benchmark -> assertThat(benchmark.getVariables().get("format")).isIn("orc", "txt")); }
@Test public void getAllBenchmarks_activeVariables_with_regex() throws IOException { withActiveVariables("format=(.rc)|(tx.)"); assertLoadedBenchmarksCount(4).forEach(benchmark -> assertThat(benchmark.getVariables().get("format")).isIn("orc", "txt") ); }
@Test public void testWithoutPrefixes() { Metadata metadata = StrategyTestUtils.createMetadata(serviceRegistry, new Hibernate5NamingStrategy(), ENTITIES); Table books = getJoinTable(metadata, "ownBooks"); Table coauthorBooks = getJoinTable(metadata, "coauthorBooks"); assertThat(books.getName()).isIn("authors_books", "authors_books_own_books"); assertThat(coauthorBooks.getName()).isIn("authors_books", "authors_books_coauthor_books"); assertThat(StrategyTestUtils.getColumNames(books)).containsOnly("fk_author", "fk_own_books"); assertThat(StrategyTestUtils.getColumNames(coauthorBooks)).containsOnly("fk_author", "fk_coauthor_books"); }
variableValues.add(var.getValue()); variableIds.add(var.getVariableId()); Assertions.assertThat(var.getOldValue()).isIn("", " ", null); Assertions.assertThat(var.getProcessInstanceId().longValue()).isEqualTo(processInstance.getId()); Assertions.assertThat(var.getProcessId()).isEqualTo(processInstance.getProcessId());
@Test public void enumDeserialization() throws Exception { valueMap.put("value1", MyEnum.VALUE1); valueMap.put("value2", MyEnum.VALUE2); String json = cartographer.toJson(valueMap); // todo: the ordering may be different on different versions of Java assertThat(json) .isIn( "{\"value2\":\"VALUE2\",\"value1\":\"VALUE1\"}", "{\"value1\":\"VALUE1\",\"value2\":\"VALUE2\"}"); valueMap = new ValueMap(cartographer.fromJson("{\"value1\":\"VALUE1\",\"value2\":\"VALUE2\"}")); assertThat(valueMap) // .contains(MapEntry.entry("value1", "VALUE1")) // .contains(MapEntry.entry("value2", "VALUE2")); assertThat(valueMap.getEnum(MyEnum.class, "value1")).isEqualTo(MyEnum.VALUE1); assertThat(valueMap.getEnum(MyEnum.class, "value2")).isEqualTo(MyEnum.VALUE2); }
@Test public void testRestrictLength() { StrategyOptions options = StrategyOptions.builder().tablePrefix("table").restrictLength(24) .restrictColumnNames(false).restrictConstraintNames(false).build(); Metadata metadata = StrategyTestUtils.createMetadata(serviceRegistry, new Hibernate5NamingStrategy(options), ENTITIES); Table books = getJoinTable(metadata, "ownBooks"); Table coauthorBooks = getJoinTable(metadata, "coauthorBooks"); assertThat(books.getName()).isIn("table_authors_books", "table_authrs_bks_own_bks"); assertThat(coauthorBooks.getName()).isIn("table_authors_books", "table_athrs_bks_cthr_bks"); }
@Test public void testWithPrefixes() { Metadata metadata = StrategyTestUtils .createMetadata(serviceRegistry, new Hibernate5NamingStrategy( StrategyOptions.builder().tablePrefix("table").build()), ENTITIES); Table books = getJoinTable(metadata, "ownBooks"); Table coauthorBooks = getJoinTable(metadata, "coauthorBooks"); assertThat(books.getName()).isIn("table_authors_books", "table_authors_books_own_books"); assertThat(coauthorBooks.getName()).isIn("table_authors_books", "table_authors_books_coauthor_books"); assertThat(StrategyTestUtils.getColumNames(books)).containsOnly("fk_author", "fk_own_books"); assertThat(StrategyTestUtils.getColumNames(coauthorBooks)).containsOnly("fk_author", "fk_coauthor_books"); }
Assertions.assertThat(var.getOldValue()).isIn("", " ", null); Assertions.assertThat(var.getProcessInstanceId().longValue()).isEqualTo(processInstance.getId()); Assertions.assertThat(var.getProcessId()).isEqualTo(processInstance.getProcessId());
variableIds.add(var.getVariableId()); Assertions.assertThat(var.getOldValue()).isIn("", " ", null); Assertions.assertThat(var.getProcessInstanceId()).isEqualTo(processInstance.getProcessInstanceId()); Assertions.assertThat(var.getProcessId()).isEqualTo(processInstance.getProcessId());
.getDescription()).isIn("Confirm this Value is Ok"); assertThat(testObject.getNewButton() .getLocale()).isEqualTo(Locale.UK);
await().untilAtomic(done, is(true)); assertThat(match.get()).isNotNull(); assertThat(match.get().getName()).isIn("foo", "baz");
await().untilAtomic(done, is(true)); assertThat(match.get()).isNotNull(); assertThat(match.get().getName()).isIn("foo", "baz");
assertThat( results ).extracting( "name" ).containsOnly( "A AA AAA", "B BA" ); assertThat( byteman.consumeNextRecordedEvent() ).isIn( AAA.class.getName(), BA.class.getName() );