diff --git a/src/main/java/seedu/address/logic/commands/RemarkCommand.java b/src/main/java/seedu/address/logic/commands/RemarkCommand.java index d2659a141e9..512906ecbcb 100644 --- a/src/main/java/seedu/address/logic/commands/RemarkCommand.java +++ b/src/main/java/seedu/address/logic/commands/RemarkCommand.java @@ -70,7 +70,7 @@ public CommandResult execute(Model model) throws CommandException { */ private String generateSuccessMessage(Person personToEdit) { String message = !remark.value.isEmpty() ? MESSAGE_ADD_REMARK_SUCCESS : MESSAGE_DELETE_REMARK_SUCCESS; - return String.format(message, personToEdit); + return String.format(message, Messages.format(personToEdit)); } @Override diff --git a/src/main/java/seedu/address/logic/parser/RemarkCommandParser.java b/src/main/java/seedu/address/logic/parser/RemarkCommandParser.java index 86e57556796..62971d6097f 100644 --- a/src/main/java/seedu/address/logic/parser/RemarkCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/RemarkCommandParser.java @@ -31,7 +31,6 @@ public RemarkCommand parse(String args) throws ParseException { } String remark = argMultimap.getValue(PREFIX_REMARK).orElse(""); - System.out.println(remark); return new RemarkCommand(index, new Remark(remark)); } } diff --git a/src/test/java/seedu/address/logic/commands/RemarkCommandTest.java b/src/test/java/seedu/address/logic/commands/RemarkCommandTest.java index 08354c0cff6..4188272a230 100644 --- a/src/test/java/seedu/address/logic/commands/RemarkCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/RemarkCommandTest.java @@ -39,7 +39,8 @@ public void execute_addRemarkUnfilteredList_success() { RemarkCommand remarkCommand = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(editedPerson.getRemark().value)); - String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, editedPerson); + String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, + Messages.format(editedPerson)); Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs()); expectedModel.setPerson(firstPerson, editedPerson); @@ -55,7 +56,8 @@ public void execute_deleteRemarkUnfilteredList_success() { RemarkCommand remarkCommand = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(editedPerson.getRemark().toString())); - String expectedMessage = String.format(RemarkCommand.MESSAGE_DELETE_REMARK_SUCCESS, editedPerson); + String expectedMessage = String.format(RemarkCommand.MESSAGE_DELETE_REMARK_SUCCESS, + Messages.format(editedPerson)); Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs()); expectedModel.setPerson(firstPerson, editedPerson); @@ -73,7 +75,7 @@ public void execute_filteredList_success() { RemarkCommand remarkCommand = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(editedPerson.getRemark().value)); - String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, editedPerson); + String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, Messages.format(editedPerson)); Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs()); expectedModel.setPerson(firstPerson, editedPerson); diff --git a/src/test/java/seedu/address/storage/JsonSerializableAddressBookTest.java b/src/test/java/seedu/address/storage/JsonSerializableAddressBookTest.java index a0acec8b9a0..8c1779c49f1 100644 --- a/src/test/java/seedu/address/storage/JsonSerializableAddressBookTest.java +++ b/src/test/java/seedu/address/storage/JsonSerializableAddressBookTest.java @@ -36,7 +36,6 @@ public void toModelType_invalidPersonFile_discardInvalidPersonOnly() throws Exce JsonSerializableAddressBook dataFromFile = JsonUtil .readJsonFile(INVALID_PERSON_FILE, JsonSerializableAddressBook.class).get(); AddressBook addressBookFromFile = dataFromFile.toModelType(); - System.out.println(addressBookFromFile.getPersonList()); Person validPerson = TypicalPersons.ALICE; assertEquals(1, addressBookFromFile.getPersonList().size()); assertEquals(validPerson, addressBookFromFile.getPersonList().get(0));