diff --git a/pom.xml b/pom.xml index 0763275..2406501 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.sadtech.autoresponder core - 1.0 + 1.1-SNAPSHOT @@ -41,6 +41,7 @@ ${log4j} + junit diff --git a/src/main/java/org/sadtech/autoresponder/Autoresponder.java b/src/main/java/org/sadtech/autoresponder/Autoresponder.java index d30ea01..da2a281 100644 --- a/src/main/java/org/sadtech/autoresponder/Autoresponder.java +++ b/src/main/java/org/sadtech/autoresponder/Autoresponder.java @@ -1,12 +1,12 @@ package org.sadtech.autoresponder; -import com.sun.istack.internal.NotNull; import lombok.AllArgsConstructor; +import lombok.NonNull; import org.sadtech.autoresponder.entity.Person; import org.sadtech.autoresponder.entity.Unit; import org.sadtech.autoresponder.service.PersonService; import org.sadtech.autoresponder.service.UnitService; -import org.sadtech.autoresponder.submodule.parser.InsertWords; +import org.sadtech.autoresponder.submodule.insertwords.InsertWords; import java.util.List; @@ -16,7 +16,7 @@ public class Autoresponder { private UnitService unitService; private PersonService personService; - public String answer(@NotNull Integer idPerson, @NotNull String message) { + public String answer(@NonNull Integer idPerson, @NonNull String message) { Person person = CheckAndAddPerson(idPerson); Unit unit; if (person.getUnit() == null) { @@ -28,7 +28,7 @@ public class Autoresponder { return unit.getAnswer(); } - public String answer(@NotNull Integer idPerson, @NotNull String message, @NotNull List words) { + public String answer(@NonNull Integer idPerson, @NonNull String message, @NonNull List words) { String answer = answer(idPerson, message); InsertWords insertWords = new InsertWords(); insertWords.setInText(answer); diff --git a/src/main/java/org/sadtech/autoresponder/service/impl/UnitServiceImpl.java b/src/main/java/org/sadtech/autoresponder/service/impl/UnitServiceImpl.java index 3d88777..aa8f8e0 100644 --- a/src/main/java/org/sadtech/autoresponder/service/impl/UnitServiceImpl.java +++ b/src/main/java/org/sadtech/autoresponder/service/impl/UnitServiceImpl.java @@ -1,7 +1,7 @@ package org.sadtech.autoresponder.service.impl; -import com.sun.istack.internal.NotNull; import lombok.AllArgsConstructor; +import lombok.NonNull; import lombok.extern.log4j.Log4j; import org.sadtech.autoresponder.entity.Unit; import org.sadtech.autoresponder.repository.UnitRepository; @@ -17,7 +17,7 @@ public class UnitServiceImpl implements UnitService { private UnitRepository unitRepository; - public Unit nextUnit(Unit unit, @NotNull String message) { + public Unit nextUnit(Unit unit, @NonNull String message) { ArrayList nextUnits = (ArrayList) unit.getNextUnits(); if (nextUnits.size() > 0) { Parser parser = new Parser(); @@ -38,7 +38,7 @@ public class UnitServiceImpl implements UnitService { } @Override - public Unit getUnitById(@NotNull Integer idUnit) { + public Unit getUnitById(@NonNull Integer idUnit) { return unitRepository.getUnitById(idUnit); } diff --git a/src/main/java/org/sadtech/autoresponder/submodule/parser/InsertWords.java b/src/main/java/org/sadtech/autoresponder/submodule/insertwords/InsertWords.java similarity index 95% rename from src/main/java/org/sadtech/autoresponder/submodule/parser/InsertWords.java rename to src/main/java/org/sadtech/autoresponder/submodule/insertwords/InsertWords.java index f44889e..cb9642b 100644 --- a/src/main/java/org/sadtech/autoresponder/submodule/parser/InsertWords.java +++ b/src/main/java/org/sadtech/autoresponder/submodule/insertwords/InsertWords.java @@ -1,4 +1,4 @@ -package org.sadtech.autoresponder.submodule.parser; +package org.sadtech.autoresponder.submodule.insertwords; import lombok.Getter; import lombok.Setter; diff --git a/src/test/java/org/sadtech/autoresponder/submodule/parser/InsertWordsTest.java b/src/test/java/org/sadtech/autoresponder/submodule/insertwords/InsertWordsTest.java similarity index 91% rename from src/test/java/org/sadtech/autoresponder/submodule/parser/InsertWordsTest.java rename to src/test/java/org/sadtech/autoresponder/submodule/insertwords/InsertWordsTest.java index f0d74b5..763bd68 100644 --- a/src/test/java/org/sadtech/autoresponder/submodule/parser/InsertWordsTest.java +++ b/src/test/java/org/sadtech/autoresponder/submodule/insertwords/InsertWordsTest.java @@ -1,8 +1,9 @@ -package org.sadtech.autoresponder.submodule.parser; +package org.sadtech.autoresponder.submodule.insertwords; import org.junit.After; import org.junit.Assert; import org.junit.Test; +import org.sadtech.autoresponder.submodule.insertwords.InsertWords; import java.util.ArrayList;