Java 类org.assertj.core.api.StrictAssertions 实例源码

项目:flipper-reverse-image-search    文件:MetadataTest.java   
@Test
public void createMetadata() throws Exception {
    int databaseSizeBeforeCreate = metadataRepository.findAll().size();

    // Create the Metadata
    metadataRepository.save(metadata);

    // Validate the Metadata in the database
    List<Metadata> metadatas = metadataRepository.findAll();
    assertThat(metadatas).hasSize(databaseSizeBeforeCreate + 1);

    /* find metadata */
    Metadata testMetadata = metadataRepository.findOne(metadata.getId());

    StrictAssertions.assertThat(testMetadata.getDirectoryName()).isEqualTo(DEFAULT_DIRECTORY_NAME);
    StrictAssertions.assertThat(testMetadata.getTagType()).isEqualTo(DEFAULT_TAG_TYPE);
    StrictAssertions.assertThat(testMetadata.getTagName()).isEqualTo(DEFAULT_TAG_NAME);
    StrictAssertions.assertThat(testMetadata.getDescription()).isEqualTo(DEFAULT_DESCRIPTION);
    StrictAssertions.assertThat(testMetadata.getPicture_id()).isEqualTo(DEFAULT_PICTURE_ID);
    StrictAssertions.assertThat(testMetadata.getTitle()).isEqualTo(DEFAULT_TITLE);
    StrictAssertions.assertThat(testMetadata.getPictureFile()).isEqualTo(DEFAULT_PICTURE_FILE);
}
项目:flipper-reverse-image-search    文件:MetadataTest.java   
@Test
public void deleteOneMetadata() throws Exception {
    Metadata deleteMetadata = this.createObject();
    int databaseSizeBeforeCreate = metadataRepository.findAll().size();

    // Create the Metadata
    metadataRepository.save(deleteMetadata);

    // Validate the Metadata in the database
    List<Metadata> metadatas = metadataRepository.findAll();
    assertThat(metadatas).hasSize(databaseSizeBeforeCreate + 1);

    /* delete metadata */
    metadataRepository.delete(deleteMetadata);

    // Validate the Metadata in the database
    metadatas = metadataRepository.findAll();
    assertThat(metadatas).hasSize(databaseSizeBeforeCreate - 1);

    // Find deleted metadata
    StrictAssertions.assertThat(metadataRepository.findOne(deleteMetadata.getId())).isEqualTo(null);
}
项目:gitlab-jira-integration    文件:CommitTest.java   
@Test
public void serializesToJSON() throws Exception {
    final Commit commit = Commit.builder()
            .id("b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327")
            .message("Update Catalan translation to e38cb41.")
            .timestamp(getDateFromString("2011-12-12T14:27:31+02:00"))
            .url("http://example.com/mike/diaspora/commit/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327")
            .build();

    final String expected = MAPPER.writeValueAsString(
            MAPPER.readValue(fixture("fixtures/gitlab/commit.json"), Commit.class));

    StrictAssertions.assertThat(MAPPER.writeValueAsString(commit)).isEqualTo(expected);
}
项目:gitlab-jira-integration    文件:UserTest.java   
@Test
public void serializesToJSON() throws Exception {
    final User user = new User(1L, "john_smith", "John Smith");

    final String expected = MAPPER.writeValueAsString(
            MAPPER.readValue(fixture("fixtures/gitlab/user.json"), User.class));

    StrictAssertions.assertThat(MAPPER.writeValueAsString(user)).isEqualTo(expected);
}
项目:compliance    文件:ContinuousSetsSearchIT.java   
/**
 * Check SequenceAnnotationSets contain some analysis data.
 * @throws GAWrapperException if the server finds the request invalid in some way
 * @throws UnirestException if there's a problem speaking HTTP to the server
 * @throws InvalidProtocolBufferException if there's a problem processing the JSON response from the server
 */
@Test
public void checkSearchingContinuousSets() throws InvalidProtocolBufferException, UnirestException, GAWrapperException {

    // Seek a list of SequenceAnnotationSets for the compliance dataset.
    final List<ContinuousSet> continuousSets = Utils.getAllContinuousSets(client);

    // check some are available
    assertThat(continuousSets).isNotEmpty();

    // Check the continuousSetId is as expected.
    continuousSets.stream()
            .forEach(sas -> StrictAssertions.assertThat(sas.getName()).isNotNull());
}
项目:compliance    文件:FeatureSetsSearchIT.java   
/**
 * Check SequenceAnnotationSets contain some analysis data.
 * @throws GAWrapperException if the server finds the request invalid in some way
 * @throws UnirestException if there's a problem speaking HTTP to the server
 * @throws InvalidProtocolBufferException if there's a problem processing the JSON response from the server
 */
@Test
public void checkSearchingFeatureSets() throws InvalidProtocolBufferException, UnirestException, GAWrapperException {

    // Seek a list of SequenceAnnotationSets for the compliance dataset.
    final List<FeatureSet> featureSets = Utils.getAllFeatureSets(client);

    // check some are available
    assertThat(featureSets).isNotEmpty();

    // Check the featureSetId is as expected.
    featureSets.stream()
            .forEach(sas -> StrictAssertions.assertThat(sas.getName()).isNotNull());
}