Example usage for org.springframework.boot.test.json ObjectContent getObject

List of usage examples for org.springframework.boot.test.json ObjectContent getObject

Introduction

In this page you can find the example usage for org.springframework.boot.test.json ObjectContent getObject.

Prototype

public T getObject() 

Source Link

Document

Return the actual object content.

Usage

From source file:com.hp.autonomy.frontend.configuration.authentication.CommunityAuthenticationTest.java

@Override
protected void validateParsedComponent(final ObjectContent<TestConfig> objectContent) {
    @SuppressWarnings("CastToConcreteClass")
    final CommunityAuthentication authentication = (CommunityAuthentication) objectContent.getObject()
            .getAuthentication();//ww w  .  ja va 2s . co  m
    final ServerConfig community = authentication.getCommunity();
    assertThat(community.getHost(), is("localhost"));
    assertThat(community.getProtocol(), is(AciServerDetails.TransportProtocol.HTTP));
    assertThat(community.getPort(), is(9030));
}

From source file:com.hp.autonomy.frontend.configuration.authentication.CommunityAuthenticationTest.java

@Override
protected void validateMergedComponent(final ObjectContent<TestConfig> objectContent) {
    @SuppressWarnings("CastToConcreteClass")
    final CommunityAuthentication authentication = (CommunityAuthentication) objectContent.getObject()
            .getAuthentication();/*from www. j  a v a2s  .  co  m*/
    final ServerConfig community = authentication.getCommunity();
    assertThat(authentication.getMethod(), is("autonomy"));
    assertThat(community.getHost(), is("test-server"));
    assertThat(community.getProtocol(), is(AciServerDetails.TransportProtocol.HTTP));
    assertThat(community.getPort(), is(9030));
    assertThat(authentication.getDefaultLogin().getUsername(), is("admin"));
    assertNotNull(authentication.getDefaultLogin().getPassword());
}

From source file:com.hp.autonomy.frontend.configuration.server.DistributedConfigTest.java

@Override
protected void validateMergedComponent(final ObjectContent<DistributedConfig> objectContent) {
    final ServerConfig standard = objectContent.getObject().getStandard();
    assertThat(standard.getHost(), is("localhost"));
    assertThat(standard.getPort(), is(9000));
    objectContent.assertThat().hasFieldOrProperty("standard").isNotNull();
    objectContent.assertThat().hasFieldOrProperty("dih").isNotNull();
    objectContent.assertThat().hasFieldOrProperty("dah").isNotNull();
}

From source file:com.hp.autonomy.frontend.configuration.server.ServerConfigTest.java

@Override
protected void validateMergedComponent(final ObjectContent<ServerConfig> objectContent) {
    objectContent.assertThat().hasFieldOrPropertyWithValue("protocol", AciServerDetails.TransportProtocol.HTTP);
    objectContent.assertThat().hasFieldOrPropertyWithValue("host", "localhost");
    objectContent.assertThat().hasFieldOrPropertyWithValue("port", 9000);
    assertThat(objectContent.getObject().getProductType(), hasSize(3));
}

From source file:com.hp.autonomy.frontend.configuration.server.ServerConfigTest.java

@Override
protected void validateParsedComponent(final ObjectContent<ServerConfig> objectContent) {
    objectContent.assertThat().hasFieldOrPropertyWithValue("protocol", AciServerDetails.TransportProtocol.HTTP);
    objectContent.assertThat().hasFieldOrPropertyWithValue("host", "localhost");
    objectContent.assertThat().hasFieldOrPropertyWithValue("port", 16000);
    assertThat(objectContent.getObject().getProductType(), hasSize(3));
}