@Test void verifyEventTypeBeingGeneratedWithProcessInstance() { final String channelName = "github"; final String processId = "COOL_PROJECT"; ProcessInstance pi = mock(ProcessInstance.class); when(pi.getProcessId()).thenReturn(processId); final String type = DataEventAttrBuilder.toType(channelName, pi); assertThat(type) .isNotBlank() .doesNotContain(processId) .contains(processId.toLowerCase()) .contains(channelName) .startsWith(AbstractDataEvent.TYPE_PREFIX); }
public static String toType(final String channelName, final ProcessInstance process) { Objects.requireNonNull(process); Objects.requireNonNull(channelName); return String.format(AbstractDataEvent.TYPE_FORMAT, process.getProcessId().toLowerCase(), channelName.toLowerCase()); }
DataEventAttrBuilder { public static String toType(final String channelName, final ProcessInstance process) { Objects.requireNonNull(process); Objects.requireNonNull(channelName); return String.format(AbstractDataEvent.TYPE_FORMAT, process.getProcessId().toLowerCase(), channelName.toLowerCase()); } }
DataEventAttrBuilder { public static String toType(final String channelName, final ProcessInstance process) { Objects.requireNonNull(process); Objects.requireNonNull(channelName); return String.format(AbstractDataEvent.TYPE_FORMAT, process.getProcessId().toLowerCase(), channelName.toLowerCase()); } private  DataEventAttrBuilder(); }
DataEventAttrBuilder { public static String toType(final String channelName, final ProcessInstance process) { Objects.requireNonNull(process); Objects.requireNonNull(channelName); return String.format(AbstractDataEvent.TYPE_FORMAT, process.getProcessId().toLowerCase(), channelName.toLowerCase()); } private  DataEventAttrBuilder(); static String toSource(final ProcessInstance process); static String toType(final String channelName, final ProcessInstance process); static String toType(final String channelName, final String processId); }
DataEventAttrBuilder { public static String toType(final String channelName, final ProcessInstance process) { Objects.requireNonNull(process); Objects.requireNonNull(channelName); return String.format(AbstractDataEvent.TYPE_FORMAT, process.getProcessId().toLowerCase(), channelName.toLowerCase()); } private  DataEventAttrBuilder(); static String toSource(final ProcessInstance process); static String toType(final String channelName, final ProcessInstance process); static String toType(final String channelName, final String processId);  }