aboutsummaryrefslogtreecommitdiffstats
path: root/messagebus/src/test/java/com/yahoo/messagebus/test/SimpleMessageTestCase.java
blob: 217f5347f406549c43f0e4a1d5b7b082988e37af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.messagebus.test;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/**
 * @author Simon Thoresen Hult
 */
public class SimpleMessageTestCase {

    @Test
    public void requireThatAccessorsWork() {
        SimpleMessage msg = new SimpleMessage("foo");
        assertEquals(SimpleProtocol.MESSAGE, msg.getType());
        assertEquals(SimpleProtocol.NAME, msg.getProtocol());
        assertEquals(3, msg.getApproxSize());
        assertEquals("foo", msg.getValue());
        msg.setValue("bar");
        assertEquals("bar", msg.getValue());
    }
}