Codota Logo
ListAssert.isEqualTo
Code IndexAdd Codota to your IDE (free)

How to use
isEqualTo
method
in
org.fest.assertions.ListAssert

Best Java code snippets using org.fest.assertions.ListAssert.isEqualTo (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: debezium/debezium

  protected void assertRegexList(String patterns, String... matches) {
    List<Pattern> regexList = Strings.listOfRegex(patterns, Pattern.CASE_INSENSITIVE);
    assertThat(regexList.stream()
        .map(Pattern::pattern)
        .collect(Collectors.toList())).isEqualTo(Arrays.asList((Object[])matches));
  }
}
origin: debezium/debezium

@Test
public void shouldFilterAndMergeGtidSet() throws Exception {
  String gtidStr = "036d85a9-64e5-11e6-9b48-42010af0000c:1-2,"
      + "7c1de3f2-3fd2-11e6-9cdc-42010af000bc:5-41";
  String availableServerGtidStr = "036d85a9-64e5-11e6-9b48-42010af0000c:1-20,"
      + "7145bf69-d1ca-11e5-a588-0242ac110004:1-3200,"
      + "123e4567-e89b-12d3-a456-426655440000:1-41";
  String purgedServerGtidStr = "";
  config = simpleConfig().with(MySqlConnectorConfig.GTID_SOURCE_INCLUDES,
                 "036d85a9-64e5-11e6-9b48-42010af0000c")
              .build();
  context = new MySqlTaskContext(config, new Filters.Builder(config).build(), false, null);
  context.start();
  context.source().setCompletedGtidSet(gtidStr);
  GtidSet mergedGtidSet = context.filterGtidSet(new GtidSet(availableServerGtidStr), new GtidSet(purgedServerGtidStr));
  assertThat(mergedGtidSet).isNotNull();
  GtidSet.UUIDSet uuidSet1 = mergedGtidSet.forServerWithId("036d85a9-64e5-11e6-9b48-42010af0000c");
  GtidSet.UUIDSet uuidSet2 = mergedGtidSet.forServerWithId("7145bf69-d1ca-11e5-a588-0242ac110004");
  GtidSet.UUIDSet uuidSet3 = mergedGtidSet.forServerWithId("123e4567-e89b-12d3-a456-426655440000");
  GtidSet.UUIDSet uuidSet4 = mergedGtidSet.forServerWithId("7c1de3f2-3fd2-11e6-9cdc-42010af000bc");
  assertThat(uuidSet1.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 2)));
  assertThat(uuidSet2.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 3200)));
  assertThat(uuidSet3.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 41)));
  assertThat(uuidSet4).isNull();
}
origin: debezium/debezium

@Test
@FixFor("DBZ-923")
public void shouldMergeToFirstAvailableGtidSetPositions() throws Exception {
  String gtidStr = "036d85a9-64e5-11e6-9b48-42010af0000c:1-2,"
      + "7c1de3f2-3fd2-11e6-9cdc-42010af000bc:5-41";
  String availableServerGtidStr = "036d85a9-64e5-11e6-9b48-42010af0000c:1-20,"
      + "7145bf69-d1ca-11e5-a588-0242ac110004:1-3200,"
      + "123e4567-e89b-12d3-a456-426655440000:1-41";
  String purgedServerGtidStr = "7145bf69-d1ca-11e5-a588-0242ac110004:1-1234";
  config = simpleConfig()
      .with(MySqlConnectorConfig.GTID_SOURCE_INCLUDES, "036d85a9-64e5-11e6-9b48-42010af0000c")
      .with(MySqlConnectorConfig.GTID_NEW_CHANNEL_POSITION, GtidNewChannelPosition.EARLIEST)
      .build();
  context = new MySqlTaskContext(config, new Filters.Builder(config).build(), false, null);
  context.start();
  context.source().setCompletedGtidSet(gtidStr);
  GtidSet mergedGtidSet = context.filterGtidSet(new GtidSet(availableServerGtidStr), new GtidSet(purgedServerGtidStr));
  assertThat(mergedGtidSet).isNotNull();
  GtidSet.UUIDSet uuidSet1 = mergedGtidSet.forServerWithId("036d85a9-64e5-11e6-9b48-42010af0000c");
  GtidSet.UUIDSet uuidSet2 = mergedGtidSet.forServerWithId("7145bf69-d1ca-11e5-a588-0242ac110004");
  GtidSet.UUIDSet uuidSet3 = mergedGtidSet.forServerWithId("123e4567-e89b-12d3-a456-426655440000");
  GtidSet.UUIDSet uuidSet4 = mergedGtidSet.forServerWithId("7c1de3f2-3fd2-11e6-9cdc-42010af000bc");
  assertThat(uuidSet1.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 2)));
  assertThat(uuidSet2.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 1234)));
  assertThat(uuidSet3).isNull();
  assertThat(uuidSet4).isNull();
}
origin: debezium/debezium

  private void validateFieldDef(Field expected) {
    ConfigDef configDef = connector.config();
    assertThat(configDef.names()).contains(expected.name());
    ConfigDef.ConfigKey key = configDef.configKeys().get(expected.name());
    assertThat(key).isNotNull();
    assertThat(key.name).isEqualTo(expected.name());
    assertThat(key.displayName).isEqualTo(expected.displayName());
    assertThat(key.importance).isEqualTo(expected.importance());
    assertThat(key.documentation).isEqualTo(expected.description());
    assertThat(key.type).isEqualTo(expected.type());
    assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
    assertThat(key.dependents).isEqualTo(expected.dependents());
    assertThat(key.width).isNotNull();
    assertThat(key.group).isNotNull();
    assertThat(key.orderInGroup).isGreaterThan(0);
    assertThat(key.validator).isNull();
    assertThat(key.recommender).isNull();
  }
}
origin: debezium/debezium

  protected static void assertConfigDefIsValid(Connector connector, io.debezium.config.Field.Set fields) {
    ConfigDef configDef = connector.config();
    assertThat(configDef).isNotNull();
    fields.forEach(expected -> {
      assertThat(configDef.names()).contains(expected.name());
      ConfigKey key = configDef.configKeys().get(expected.name());
      assertThat(key).isNotNull();
      assertThat(key.name).isEqualTo(expected.name());
      assertThat(key.displayName).isEqualTo(expected.displayName());
      assertThat(key.importance).isEqualTo(expected.importance());
      assertThat(key.documentation).isEqualTo(expected.description());
      assertThat(key.type).isEqualTo(expected.type());
      if (expected.equals(MySqlConnectorConfig.DATABASE_HISTORY) || expected.equals(MySqlConnectorConfig.JDBC_DRIVER)) {
        assertThat(((Class<?>) key.defaultValue).getName()).isEqualTo((String) expected.defaultValue());
      } else if (!expected.equals(MySqlConnectorConfig.SERVER_ID)) {
        assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
      }
      assertThat(key.dependents).isEqualTo(expected.dependents());
      assertThat(key.width).isNotNull();
      assertThat(key.group).isNotNull();
      assertThat(key.orderInGroup).isGreaterThan(0);
      assertThat(key.validator).isNull();
      assertThat(key.recommender).isNull();
    });
  }
}
origin: debezium/debezium

protected static void assertConfigDefIsValid(Connector connector, io.debezium.config.Field.Set fields) {
  ConfigDef configDef = connector.config();
  assertThat(configDef).isNotNull();
  fields.forEach(expected -> {
    assertThat(configDef.names()).contains(expected.name());
    ConfigKey key = configDef.configKeys().get(expected.name());
    assertThat(key).isNotNull();
    assertThat(key.name).isEqualTo(expected.name());
    assertThat(key.displayName).isEqualTo(expected.displayName());
    assertThat(key.importance).isEqualTo(expected.importance());
    assertThat(key.documentation).isEqualTo(expected.description());
    assertThat(key.type).isEqualTo(expected.type());
    assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
    assertThat(key.dependents).isEqualTo(expected.dependents());
    assertThat(key.width).isNotNull();
    assertThat(key.group).isNotNull();
    assertThat(key.orderInGroup).isGreaterThan(0);
    assertThat(key.validator).isNull();
    assertThat(key.recommender).isNull();
  });
}
origin: io.sphere.jvmsdk/javaintegrationtestlib

private void assertModelsInBackend() {
  final List<T> instances = createInBackendByName(modelNames());
  final List<String> actualNames = instances.stream().map(o -> extractName(o)).
      filter(name -> modelNames().contains(name)).sorted().collect(toList());
  assertThat(actualNames).
      overridingErrorMessage(String.format("The test requires instances with the names %s.", Iterables.toString(modelNames()))).
      isEqualTo(modelNames());
}
origin: io.sphere.sdk.jvm/test-lib

private void assertModelsInBackend() {
  final List<T> instances = createInBackendByName(modelNames());
  final List<String> actualNames = instances.stream().map(o -> extractName(o)).
      filter(name -> modelNames().contains(name)).sorted().collect(toList());
  assertThat(actualNames).
      overridingErrorMessage(String.format("The test requires instances with the names %s.", IterableUtils.toString(modelNames()))).
      isEqualTo(modelNames());
}
origin: gosu-lang/old-gosu-repo

public void assertManifestContainsSourcesEntry(IDirectory dir, String expectedSources) {
 HashSet<String> found = new HashSet<String>();
 DynamicArray<? extends IFile> files = IDirectoryUtil.allContainedFilesExcludingIgnored(dir);
 for (IFile file : files) {
  String extension = file.getExtension();
  if (extension.equals("gs") || extension.equals("gsx") || extension.equals("xsd")) {
   found.add(extension);
  }
 }
 List<String> foundExtensions = new ArrayList<String>(found);
 Collections.sort(foundExtensions);
 if (expectedSources != null) {
  List<String> expectedSourceExtensions = Arrays.asList(expectedSources.split(","));
  Assertions.assertThat(foundExtensions)
      .as("the set of extensions in the manifest (Contains-Sources) don't match the set found in the jar")
      .isEqualTo(expectedSourceExtensions);
  assertEquals(expectedSources, _mf.getMainAttributes().getValue("Contains-Sources"));
 }
 else {
  Assertions.assertThat(foundExtensions).isEmpty();
  assertNull(_mf.getMainAttributes().getValue("Contains-Sources"));
 }
}
origin: io.sphere.jvmsdk/javaintegrationtestlib

@Test
public void queryAllScenario() {
  assertModelsNotPresent();
  assertModelsInBackend();
  final PagedQueryResult<T> queryResult = queryAll();
  assertThat(getNames(queryResult.getResults()).stream().
      filter(name -> modelNames().contains(name)).sorted().collect(toList())).isEqualTo(modelNames());
  cleanUpByName(modelNames());
}
origin: hibernate/hibernate-ogm

@Test
public void testResultListWithoutProjection() {
  inTransaction( session -> {
    List<Movie> movies = session.createQuery( JPQL_QUERY_WITHOUT_PROJECTION )
      .getResultList();
    assertThat( movies ).isEqualTo( Collections.singletonList( originalMovie ) );
  } );
}
origin: hibernate/hibernate-ogm

/**
 * This methods behave like {@link ListAssert#containsExactly(Object...)} with the exception that the order of the
 * null elements is ignored if {@link OrderedListAssert#ignoreNullOrder()} is called.
 * Note that in this last case, the test will fail if nulls are both at the end and at the beginning.
 *
 * @see ListAssert#containsExactly(Object...)
 */
@Override
public OrderedListAssert containsExactly(Object... expected) {
  if ( ignoringNullPosition ) {
    Assertions.assertThat( actual ).hasSize( expected.length );
    List<Object> actualWithoutNull = trimNull( actual );
    List<Object> expectedWithoutNull = trimNull( Arrays.asList( expected ) );
    Assertions.assertThat( actualWithoutNull ).isEqualTo( expectedWithoutNull );
    if ( actual.size() > 1 && actualWithoutNull.size() > 0 ) {
      if ( actual.get( 0 ) == null && actual.get( actual.size() - 1 ) == null ) {
        throw failure( "Null order should be consistent: " + actual );
      }
    }
  }
  else {
    super.containsExactly( expected );
  }
  return this;
}
origin: io.debezium/debezium-connector-mysql

@Test
public void shouldFilterAndMergeGtidSet() throws Exception {
  String gtidStr = "036d85a9-64e5-11e6-9b48-42010af0000c:1-2,"
      + "7c1de3f2-3fd2-11e6-9cdc-42010af000bc:5-41";
  String availableServerGtidStr = "036d85a9-64e5-11e6-9b48-42010af0000c:1-20,"
      + "7145bf69-d1ca-11e5-a588-0242ac110004:1-3200,"
      + "123e4567-e89b-12d3-a456-426655440000:1-41";
  String purgedServerGtidStr = "";
  config = simpleConfig().with(MySqlConnectorConfig.GTID_SOURCE_INCLUDES,
                 "036d85a9-64e5-11e6-9b48-42010af0000c")
              .build();
  context = new MySqlTaskContext(config, new Filters.Builder(config).build(), false, null);
  context.start();
  context.source().setCompletedGtidSet(gtidStr);
  GtidSet mergedGtidSet = context.filterGtidSet(new GtidSet(availableServerGtidStr), new GtidSet(purgedServerGtidStr));
  assertThat(mergedGtidSet).isNotNull();
  GtidSet.UUIDSet uuidSet1 = mergedGtidSet.forServerWithId("036d85a9-64e5-11e6-9b48-42010af0000c");
  GtidSet.UUIDSet uuidSet2 = mergedGtidSet.forServerWithId("7145bf69-d1ca-11e5-a588-0242ac110004");
  GtidSet.UUIDSet uuidSet3 = mergedGtidSet.forServerWithId("123e4567-e89b-12d3-a456-426655440000");
  GtidSet.UUIDSet uuidSet4 = mergedGtidSet.forServerWithId("7c1de3f2-3fd2-11e6-9cdc-42010af000bc");
  assertThat(uuidSet1.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 2)));
  assertThat(uuidSet2.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 3200)));
  assertThat(uuidSet3.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 41)));
  assertThat(uuidSet4).isNull();
}
origin: io.debezium/debezium-connector-mysql

@Test
@FixFor("DBZ-923")
public void shouldMergeToFirstAvailableGtidSetPositions() throws Exception {
  String gtidStr = "036d85a9-64e5-11e6-9b48-42010af0000c:1-2,"
      + "7c1de3f2-3fd2-11e6-9cdc-42010af000bc:5-41";
  String availableServerGtidStr = "036d85a9-64e5-11e6-9b48-42010af0000c:1-20,"
      + "7145bf69-d1ca-11e5-a588-0242ac110004:1-3200,"
      + "123e4567-e89b-12d3-a456-426655440000:1-41";
  String purgedServerGtidStr = "7145bf69-d1ca-11e5-a588-0242ac110004:1-1234";
  config = simpleConfig()
      .with(MySqlConnectorConfig.GTID_SOURCE_INCLUDES, "036d85a9-64e5-11e6-9b48-42010af0000c")
      .with(MySqlConnectorConfig.GTID_NEW_CHANNEL_POSITION, GtidNewChannelPosition.EARLIEST)
      .build();
  context = new MySqlTaskContext(config, new Filters.Builder(config).build(), false, null);
  context.start();
  context.source().setCompletedGtidSet(gtidStr);
  GtidSet mergedGtidSet = context.filterGtidSet(new GtidSet(availableServerGtidStr), new GtidSet(purgedServerGtidStr));
  assertThat(mergedGtidSet).isNotNull();
  GtidSet.UUIDSet uuidSet1 = mergedGtidSet.forServerWithId("036d85a9-64e5-11e6-9b48-42010af0000c");
  GtidSet.UUIDSet uuidSet2 = mergedGtidSet.forServerWithId("7145bf69-d1ca-11e5-a588-0242ac110004");
  GtidSet.UUIDSet uuidSet3 = mergedGtidSet.forServerWithId("123e4567-e89b-12d3-a456-426655440000");
  GtidSet.UUIDSet uuidSet4 = mergedGtidSet.forServerWithId("7c1de3f2-3fd2-11e6-9cdc-42010af000bc");
  assertThat(uuidSet1.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 2)));
  assertThat(uuidSet2.getIntervals()).isEqualTo(Arrays.asList(new GtidSet.Interval(1, 1234)));
  assertThat(uuidSet3).isNull();
  assertThat(uuidSet4).isNull();
}
origin: racodond/sonar-css-plugin

private static void verifyIssue(TestIssue expected, Issue actual, File file) {
 if (line(actual) > expected.line()) {
  fail("Missing issue at line " + expected.line() + " in file " + file.getAbsolutePath());
 }
 if (line(actual) < expected.line()) {
  fail("Unexpected issue at line " + line(actual) + ": \"" + message(actual) + "\"" + " in file " + file.getAbsolutePath());
 }
 if (expected.message() != null) {
  assertThat(message(actual)).as("Bad message at line " + expected.line()).isEqualTo(expected.message());
 }
 if (expected.effortToFix() != null) {
  assertThat(actual.cost()).as("Bad effortToFix at line " + expected.line()).isEqualTo(expected.effortToFix());
 }
 if (expected.startColumn() != null) {
  assertThat(((PreciseIssue) actual).primaryLocation().startLineOffset() + 1).as("Bad start column at line " + expected.line()).isEqualTo(expected.startColumn());
 }
 if (expected.endColumn() != null) {
  assertThat(((PreciseIssue) actual).primaryLocation().endLineOffset() + 1).as("Bad end column at line " + expected.line()).isEqualTo(expected.endColumn());
 }
 if (expected.endLine() != null) {
  assertThat(((PreciseIssue) actual).primaryLocation().endLine()).as("Bad end line at line " + expected.line()).isEqualTo(expected.endLine());
 }
 if (expected.secondaryLines() != null) {
  assertThat(secondary(actual)).as("Bad secondary locations at line " + expected.line()).isEqualTo(expected.secondaryLines());
 }
}
origin: org.codehaus.sonar-plugins.css/css-checks-testkit

private static void verifyIssue(TestIssue expected, Issue actual, File file) {
 if (line(actual) > expected.line()) {
  fail("Missing issue at line " + expected.line() + " in file " + file.getAbsolutePath());
 }
 if (line(actual) < expected.line()) {
  fail("Unexpected issue at line " + line(actual) + ": \"" + message(actual) + "\"" + " in file " + file.getAbsolutePath());
 }
 if (expected.message() != null) {
  assertThat(message(actual)).as("Bad message at line " + expected.line()).isEqualTo(expected.message());
 }
 if (expected.effortToFix() != null) {
  assertThat(actual.cost()).as("Bad effortToFix at line " + expected.line()).isEqualTo(expected.effortToFix());
 }
 if (expected.startColumn() != null) {
  assertThat(((PreciseIssue) actual).primaryLocation().startLineOffset() + 1).as("Bad start column at line " + expected.line()).isEqualTo(expected.startColumn());
 }
 if (expected.endColumn() != null) {
  assertThat(((PreciseIssue) actual).primaryLocation().endLineOffset() + 1).as("Bad end column at line " + expected.line()).isEqualTo(expected.endColumn());
 }
 if (expected.endLine() != null) {
  assertThat(((PreciseIssue) actual).primaryLocation().endLine()).as("Bad end line at line " + expected.line()).isEqualTo(expected.endLine());
 }
 if (expected.secondaryLines() != null) {
  assertThat(secondary(actual)).as("Bad secondary locations at line " + expected.line()).isEqualTo(expected.secondaryLines());
 }
}
origin: io.debezium/debezium-connector-postgres

  private void validateFieldDef(Field expected) {
    ConfigDef configDef = connector.config();
    assertThat(configDef.names()).contains(expected.name());
    ConfigDef.ConfigKey key = configDef.configKeys().get(expected.name());
    assertThat(key).isNotNull();
    assertThat(key.name).isEqualTo(expected.name());
    assertThat(key.displayName).isEqualTo(expected.displayName());
    assertThat(key.importance).isEqualTo(expected.importance());
    assertThat(key.documentation).isEqualTo(expected.description());
    assertThat(key.type).isEqualTo(expected.type());
    assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
    assertThat(key.dependents).isEqualTo(expected.dependents());
    assertThat(key.width).isNotNull();
    assertThat(key.group).isNotNull();
    assertThat(key.orderInGroup).isGreaterThan(0);
    assertThat(key.validator).isNull();
    assertThat(key.recommender).isNull();
  }
}
origin: io.debezium/debezium-connector-mysql

  protected static void assertConfigDefIsValid(Connector connector, io.debezium.config.Field.Set fields) {
    ConfigDef configDef = connector.config();
    assertThat(configDef).isNotNull();
    fields.forEach(expected -> {
      assertThat(configDef.names()).contains(expected.name());
      ConfigKey key = configDef.configKeys().get(expected.name());
      assertThat(key).isNotNull();
      assertThat(key.name).isEqualTo(expected.name());
      assertThat(key.displayName).isEqualTo(expected.displayName());
      assertThat(key.importance).isEqualTo(expected.importance());
      assertThat(key.documentation).isEqualTo(expected.description());
      assertThat(key.type).isEqualTo(expected.type());
      if (expected.equals(MySqlConnectorConfig.DATABASE_HISTORY) || expected.equals(MySqlConnectorConfig.JDBC_DRIVER)) {
        assertThat(((Class<?>) key.defaultValue).getName()).isEqualTo((String) expected.defaultValue());
      } else if (!expected.equals(MySqlConnectorConfig.SERVER_ID)) {
        assertThat(key.defaultValue).isEqualTo(expected.defaultValue());
      }
      assertThat(key.dependents).isEqualTo(expected.dependents());
      assertThat(key.width).isNotNull();
      assertThat(key.group).isNotNull();
      assertThat(key.orderInGroup).isGreaterThan(0);
      assertThat(key.validator).isNull();
      assertThat(key.recommender).isNull();
    });
  }
}
org.fest.assertionsListAssertisEqualTo

Popular methods of ListAssert

  • hasSize
  • isEmpty
  • containsExactly
  • as
  • containsOnly
  • isNotNull
  • contains
  • isNotEmpty
  • isNull
  • containsSequence
  • excludes
  • isNullOrEmpty
  • excludes,
  • isNullOrEmpty,
  • overridingErrorMessage,
  • isSameAs,
  • onProperty

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • JFileChooser (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now