Search in sources :

Example 1 with MultiPayloadAdaptrisMessageImp

use of com.adaptris.core.MultiPayloadAdaptrisMessageImp in project interlok by adaptris.

the class MultiPayloadMessageSplitterTest method testNonCloneableMessage.

@Test
@SuppressWarnings("serial")
public void testNonCloneableMessage() {
    List<AdaptrisMessage> response = (List<AdaptrisMessage>) splitter.splitMessage(new MultiPayloadAdaptrisMessageImp("bacon", new GuidGenerator(), DefaultMessageFactory.getDefaultInstance(), PAYLOAD_1.getBytes()) {

        @Override
        public MessageLifecycleEvent getMessageLifecycleEvent() {
            return new MessageLifecycleEvent() {

                @Override
                public List<MleMarker> getMleMarkers() {
                    List<MleMarker> list = new ArrayList<>();
                    list.add(new MleMarker() {

                        @Override
                        public Object clone() throws CloneNotSupportedException {
                            throw new CloneNotSupportedException();
                        }
                    });
                    return list;
                }
            };
        }
    });
    assertEquals(0, response.size());
}
Also used : MultiPayloadAdaptrisMessageImp(com.adaptris.core.MultiPayloadAdaptrisMessageImp) MessageLifecycleEvent(com.adaptris.core.MessageLifecycleEvent) MultiPayloadAdaptrisMessage(com.adaptris.core.MultiPayloadAdaptrisMessage) AdaptrisMessage(com.adaptris.core.AdaptrisMessage) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) GuidGenerator(com.adaptris.util.GuidGenerator) MleMarker(com.adaptris.core.MleMarker) Test(org.junit.Test)

Example 2 with MultiPayloadAdaptrisMessageImp

use of com.adaptris.core.MultiPayloadAdaptrisMessageImp in project interlok by adaptris.

the class ForEachTest method testNonCloneableMessage.

@Test
@SuppressWarnings("serial")
public void testNonCloneableMessage() throws Exception {
    forEach.doService(new MultiPayloadAdaptrisMessageImp("bacon", new GuidGenerator(), DefaultMessageFactory.getDefaultInstance(), PAYLOAD_1) {

        @Override
        public MessageLifecycleEvent getMessageLifecycleEvent() {
            return new MessageLifecycleEvent() {

                @Override
                public List<MleMarker> getMleMarkers() {
                    List<MleMarker> list = new ArrayList<>();
                    list.add(new MleMarker() {

                        @Override
                        public Object clone() throws CloneNotSupportedException {
                            throw new CloneNotSupportedException();
                        }
                    });
                    return list;
                }
            };
        }
    });
    verify(mock, never()).doService(any(AdaptrisMessage.class));
}
Also used : MultiPayloadAdaptrisMessageImp(com.adaptris.core.MultiPayloadAdaptrisMessageImp) MessageLifecycleEvent(com.adaptris.core.MessageLifecycleEvent) AdaptrisMessage(com.adaptris.core.AdaptrisMessage) MultiPayloadAdaptrisMessage(com.adaptris.core.MultiPayloadAdaptrisMessage) ArrayList(java.util.ArrayList) List(java.util.List) GuidGenerator(com.adaptris.util.GuidGenerator) MleMarker(com.adaptris.core.MleMarker) Test(org.junit.Test)

Aggregations

AdaptrisMessage (com.adaptris.core.AdaptrisMessage)2 MessageLifecycleEvent (com.adaptris.core.MessageLifecycleEvent)2 MleMarker (com.adaptris.core.MleMarker)2 MultiPayloadAdaptrisMessage (com.adaptris.core.MultiPayloadAdaptrisMessage)2 MultiPayloadAdaptrisMessageImp (com.adaptris.core.MultiPayloadAdaptrisMessageImp)2 GuidGenerator (com.adaptris.util.GuidGenerator)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Test (org.junit.Test)2