diff --git a/.gitignore b/.gitignore
index 288a569..5b48466 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@ local.properties
.settings/
.loadpath
.recommenders
+JavaDoc/
# External tool builders
.externalToolBuilders/
@@ -60,3 +61,5 @@ local.properties
#.project
/target/
api-key.txt
+
+
diff --git a/pom.xml b/pom.xml
index 6e457ab..a5ee55a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -67,6 +67,12 @@
guava-annotations
r03
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.4.0
+ test
+
diff --git a/src/main/java/edu/mills/cs180a/wordui/FXMLController.java b/src/main/java/edu/mills/cs180a/wordui/FXMLController.java
index 8439ec7..09a81a2 100644
--- a/src/main/java/edu/mills/cs180a/wordui/FXMLController.java
+++ b/src/main/java/edu/mills/cs180a/wordui/FXMLController.java
@@ -132,9 +132,13 @@ private void configureButtons() {
.or(freqValidProperty.not())
.or(wordTextField.textProperty().isEmpty())
.or(definitionTextArea.textProperty().isEmpty()));
-
- // TODO: Disable the Create button if an existing entry is selected or any
+ // Disable the Create button if an existing entry is selected or any
// field is empty or invalid.
+ createButton.disableProperty()
+ .bind(listView.getSelectionModel().selectedItemProperty().isNotNull()
+ .or(wordTextField.textProperty().isEmpty())
+ .or(freqValidProperty.not())
+ .or(definitionTextArea.textProperty().isEmpty()));
}
// A frequency is valid if it is an integer and is at least 0.
diff --git a/src/main/java/edu/mills/cs180a/wordui/model/SampleData.java b/src/main/java/edu/mills/cs180a/wordui/model/SampleData.java
index f9d8846..9262d32 100644
--- a/src/main/java/edu/mills/cs180a/wordui/model/SampleData.java
+++ b/src/main/java/edu/mills/cs180a/wordui/model/SampleData.java
@@ -42,37 +42,54 @@ private static int getFrequencyFromSummary(FrequencySummary fs, int year) {
return 0;
}
- // TODO: Move to spring-swagger-wordnik-client
@VisibleForTesting
protected static int getFrequencyByYear(WordApi wordApi, String word, int year) {
FrequencySummary fs = wordApi.getWordFrequency(word, "false", year, year);
return getFrequencyFromSummary(fs, year);
}
- private static WordRecord buildWordRecord(String word, Map