@Test public void testEquality() { final NessEventType eventType1 = new NessEventType("foo"); final NessEventType eventType2 = new NessEventType("FOO"); Assert.assertTrue(eventType1.equals(eventType2)); }
@Test public void testEqualityFactory() { final NessEventType eventType1 = NessEventType.getForName("foo"); final NessEventType eventType2 = NessEventType.getForName("FOO"); Assert.assertTrue(eventType1.equals(eventType2)); }
public void testNullFactory() { final NessEventType eventType = NessEventType.getForName(null); Assert.assertEquals("", eventType.getName()); } }
@Test public void testSimple() { final NessEventType eventType = new NessEventType("FOO"); Assert.assertEquals("FOO", eventType.getName()); }
@Test public void testFuckImmutability() throws Exception { final Map<String, Object> nullPayLoad = Collections.<String, Object>singletonMap("test", null); String serialized = mapper.writeValueAsString(NessEvent.createEvent(null, NessEventType.getForName(null), nullPayLoad)); Assert.assertTrue(StringUtils.contains(serialized, "\"test\":null")); }
@Override public boolean accept(final NessEvent event) { return event != null && eventType.equals(event.getType()); }
@JsonCreator public static NessEventType getForName(@Nullable final String name) { return (name == null) ? UNKNOWN : new NessEventType(name); }
@Test public void testToUpper() { final NessEventType eventType = new NessEventType("foo"); Assert.assertEquals("FOO", eventType.getName()); }
eventSender.enqueue(NessEvent.createEvent(null, NessEventType.getForName(null))); Thread.sleep(1000L); Assert.assertTrue(jmsEventTransport.isConnected());
@Override public boolean accept(final NessEvent event) { return event != null && eventType.equals(event.getType()); }
@Test(expected=IllegalArgumentException.class) @SuppressWarnings({"NP_NONNULL_PARAM_VIOLATION"}) public void testNullCtor() { new NessEventType(null); }
@Test public void testSimpleFactory() { final NessEventType eventType = NessEventType.getForName("FOO"); Assert.assertEquals("FOO", eventType.getName()); }
Assert.assertFalse(jmsEventTransport.isConnected()); Assert.assertNotNull(eventSender); eventSender.enqueue(NessEvent.createEvent(null, NessEventType.getForName(null))); Thread.sleep(1000L); Assert.assertTrue(jmsEventTransport.isConnected());
@Test public void testToUpperFactory() { final NessEventType eventType = NessEventType.getForName("foo"); Assert.assertEquals("FOO", eventType.getName()); }