AbstractLauncher implements Runnable { public String getMember() { if (isNotBlank(getMemberName())) { return getMemberName(); } if (isNotBlank(getMemberId())) { return getMemberId(); } return null; } AbstractLauncher(); boolean isDebugging(); void setDebug(final boolean debug); boolean isRunning(); abstract String getLogFileName(); String getMember(); String getMemberId(); String getMemberName(); abstract Integer getPid(); abstract String getServiceName(); String getWorkingDirectory(); String version(); static final String MEMBER_NAME_ERROR_MESSAGE; static final String WORKING_DIRECTORY_OPTION_NOT_VALID_ERROR_MESSAGE; static final String WORKING_DIRECTORY_NOT_FOUND_ERROR_MESSAGE; static final String DEFAULT_WORKING_DIRECTORY; static final String SIGNAL_HANDLER_REGISTRATION_SYSTEM_PROPERTY; }
@Test public void getMemberReturnsNullIfMemberIdIsNull() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, null); assertThat(launcher.getMember()).isNull(); }
@Test public void getMemberReturnNullIfMemberIdIsEmpty() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, StringUtils.EMPTY); assertThat(launcher.getMember()).isNull(); }
@Test public void getMemberReturnNullIfMemberIdIsBlank() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, " "); assertThat(launcher.getMember()).isNull(); }