mil.dod.th.remote.client/test/mil/dod/th/remote/client/generate/impl/TestEventRegistrationBuilderImpl.java
@Test
    public void testBuild() throws InvalidProtocolBufferException
    {
        // replay
        TerraHarvestPayload payload = m_SUT.setCanQueueEvent(false)
            .setExpirationTimeHours(200)
            .setTopics("testtopic1", "testtopic2")
            .setObjectFormat(LexiconFormat.Enum.XML)
            .build();

        // verify
        EventAdminNamespace namespaceMessage = EventAdminNamespace.parseFrom(payload.getNamespaceMessage());
        EventRegistrationRequestData data = EventRegistrationRequestData.parseFrom(namespaceMessage.getData());
        assertThat(payload.getNamespace(), is(Namespace.EventAdmin));
        assertThat(data.getCanQueueEvent(), is(false));
        assertThat(data.getExpirationTimeHours(), is(200));
        assertThat(data.getTopic(0), is("testtopic1"));
        assertThat(data.getTopic(1), is("testtopic2"));
        assertThat(data.getObjectFormat(), is(LexiconFormat.Enum.XML));
    }
/**
     * Verify that a valid payload message can be generated.
     */
Verify that a valid payload message can be generated.
Verify that a valid payload message can be generated .
@Test
    public void testBuild() throws InvalidProtocolBufferException
    {
        TerraHarvestPayload payload = m_SUT.setCanQueueEvent(false)
            .setExpirationTimeHours(200)
            .setTopics("testtopic1", "testtopic2")
            .setObjectFormat(LexiconFormat.Enum.XML)
            .build();
        EventAdminNamespace namespaceMessage = EventAdminNamespace.parseFrom(payload.getNamespaceMessage());
        EventRegistrationRequestData data = EventRegistrationRequestData.parseFrom(namespaceMessage.getData());
        assertThat(payload.getNamespace(), is(Namespace.EventAdmin));
        assertThat(data.getCanQueueEvent(), is(false));
        assertThat(data.getExpirationTimeHours(), is(200));
        assertThat(data.getTopic(0), is("testtopic1"));
        assertThat(data.getTopic(1), is("testtopic2"));
        assertThat(data.getObjectFormat(), is(LexiconFormat.Enum.XML));
    }
@ Test public void testBuild ( ) throws InvalidProtocolBufferException { TerraHarvestPayload payload = m_SUT . setCanQueueEvent ( false ) . setExpirationTimeHours ( 200 ) . setTopics ( "testtopic1" , "testtopic2" ) . setObjectFormat ( LexiconFormat . Enum . XML ) . build ( ) ; EventAdminNamespace namespaceMessage = EventAdminNamespace . parseFrom ( payload . getNamespaceMessage ( ) ) ; EventRegistrationRequestData data = EventRegistrationRequestData . parseFrom ( namespaceMessage . getData ( ) ) ; assertThat ( payload . getNamespace ( ) , is ( Namespace . EventAdmin ) ) ; assertThat ( data . getCanQueueEvent ( ) , is ( false ) ) ; assertThat ( data . getExpirationTimeHours ( ) , is ( 200 ) ) ; assertThat ( data . getTopic ( 0 ) , is ( "testtopic1" ) ) ; assertThat ( data . getTopic ( 1 ) , is ( "testtopic2" ) ) ; assertThat ( data . getObjectFormat ( ) , is ( LexiconFormat . Enum . XML ) ) ; }
Verify that a valid payload message can be generated.
Verify that a valid payload message can be generated .
// replay // verify