@Test public void testAddWithReplaceBlankName() { IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> { builder.addWithReplace(" ", mock(Record.class)); }); assertThat(e.getMessage()).isEqualTo("Record name cannot be blank."); }
public void addWithReplace(final String recordName, final Record record) { if (recordName == null) throw new NullPointerException("Record name cannot be null."); if (record == null) throw new NullPointerException("Record cannot be null."); if (recordName.trim().length() == 0) throw new IllegalArgumentException("Record name cannot be blank."); final String upperName = recordName.toUpperCase(Locale.getDefault()); records.put(upperName, record); }
ScriptExecutionBuilder { public void addWithReplace(final String recordName, final Record record) { if (recordName == null) throw new NullPointerException("Record name cannot be null."); if (record == null) throw new NullPointerException("Record cannot be null."); if (recordName.trim().length() == 0) throw new IllegalArgumentException("Record name cannot be blank."); final String upperName = recordName.toUpperCase(Locale.getDefault()); records.put(upperName, record); } }
ScriptExecutionBuilder { public void addWithReplace(final String recordName, final Record record) { if (recordName == null) throw new NullPointerException("Record name cannot be null."); if (record == null) throw new NullPointerException("Record cannot be null."); if (recordName.trim().length() == 0) throw new IllegalArgumentException("Record name cannot be blank."); final String upperName = recordName.toUpperCase(Locale.getDefault()); records.put(upperName, record); } private  ScriptExecutionBuilder(final String scriptName); }
ScriptExecutionBuilder { public void addWithReplace(final String recordName, final Record record) { if (recordName == null) throw new NullPointerException("Record name cannot be null."); if (record == null) throw new NullPointerException("Record cannot be null."); if (recordName.trim().length() == 0) throw new IllegalArgumentException("Record name cannot be blank."); final String upperName = recordName.toUpperCase(Locale.getDefault()); records.put(upperName, record); } private  ScriptExecutionBuilder(final String scriptName); static ScriptExecutionBuilder getBuilder(final String scriptName); void addWithReplace(final String recordName, final Record record); Collection<String> build(); String getScriptName(); ScriptExecutionBuilder withArguments(final List<Argument> arguments); }
ScriptExecutionBuilder { public void addWithReplace(final String recordName, final Record record) { if (recordName == null) throw new NullPointerException("Record name cannot be null."); if (record == null) throw new NullPointerException("Record cannot be null."); if (recordName.trim().length() == 0) throw new IllegalArgumentException("Record name cannot be blank."); final String upperName = recordName.toUpperCase(Locale.getDefault()); records.put(upperName, record); } private  ScriptExecutionBuilder(final String scriptName); static ScriptExecutionBuilder getBuilder(final String scriptName); void addWithReplace(final String recordName, final Record record); Collection<String> build(); String getScriptName(); ScriptExecutionBuilder withArguments(final List<Argument> arguments);  }