Отказ от Lombok

This commit is contained in:
Mark Struchkov 2019-01-24 21:37:08 +03:00
parent 55d164764e
commit f6900c2407
5 changed files with 13 additions and 20 deletions

10
pom.xml
View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.sadtech.autoresponder</groupId> <groupId>org.sadtech.autoresponder</groupId>
<artifactId>core</artifactId> <artifactId>autoresponder</artifactId>
<version>1.1.2-SNAPHOT</version> <version>1.1.2-SNAPHOT</version>
<build> <build>
<plugins> <plugins>
@ -22,20 +22,12 @@
</build> </build>
<properties> <properties>
<lombok.ver>1.18.4</lombok.ver>
<log4j>1.2.17</log4j> <log4j>1.2.17</log4j>
<junit.ver>4.12</junit.ver> <junit.ver>4.12</junit.ver>
<mocito.ver>2.23.4</mocito.ver> <mocito.ver>2.23.4</mocito.ver>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
</dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>

View File

@ -1,6 +1,6 @@
package org.sadtech.autoresponder; package org.sadtech.autoresponder;
import lombok.extern.log4j.Log4j; import org.apache.log4j.Logger;
import org.sadtech.autoresponder.entity.Person; import org.sadtech.autoresponder.entity.Person;
import org.sadtech.autoresponder.entity.Unit; import org.sadtech.autoresponder.entity.Unit;
import org.sadtech.autoresponder.entity.compare.UnitPriorityComparator; import org.sadtech.autoresponder.entity.compare.UnitPriorityComparator;
@ -13,9 +13,10 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
@Log4j
public class Autoresponder { public class Autoresponder {
public static final Logger log = Logger.getLogger(Autoresponder.class);
private UnitService unitService; private UnitService unitService;
private PersonService personService; private PersonService personService;

View File

@ -1,13 +1,15 @@
package org.sadtech.autoresponder.service.impl; package org.sadtech.autoresponder.service.impl;
import lombok.extern.log4j.Log4j;
import org.sadtech.autoresponder.entity.Person; import org.sadtech.autoresponder.entity.Person;
import org.sadtech.autoresponder.repository.PersonRepository; import org.sadtech.autoresponder.repository.PersonRepository;
import org.sadtech.autoresponder.service.PersonService; import org.sadtech.autoresponder.service.PersonService;
@Log4j import org.apache.log4j.Logger;
public class PersonServiceImpl implements PersonService { public class PersonServiceImpl implements PersonService {
private static final Logger log = Logger.getLogger(PersonServiceImpl.class);
private PersonRepository personRepository; private PersonRepository personRepository;
public PersonServiceImpl(PersonRepository personRepository) { public PersonServiceImpl(PersonRepository personRepository) {

View File

@ -1,6 +1,6 @@
package org.sadtech.autoresponder.service.impl; package org.sadtech.autoresponder.service.impl;
import lombok.extern.log4j.Log4j; import org.apache.log4j.Logger;
import org.sadtech.autoresponder.entity.Unit; import org.sadtech.autoresponder.entity.Unit;
import org.sadtech.autoresponder.repository.UnitRepository; import org.sadtech.autoresponder.repository.UnitRepository;
import org.sadtech.autoresponder.service.UnitService; import org.sadtech.autoresponder.service.UnitService;
@ -8,9 +8,10 @@ import org.sadtech.autoresponder.service.UnitService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@Log4j
public class UnitServiceImpl implements UnitService { public class UnitServiceImpl implements UnitService {
private static final Logger log = Logger.getLogger(UnitServiceImpl.class);
private List<UnitRepository> unitRepositories; private List<UnitRepository> unitRepositories;
public UnitServiceImpl() { public UnitServiceImpl() {

View File

@ -38,7 +38,6 @@ public class AutoresponderTest {
words2.add("тест"); words2.add("тест");
words2.add("привет"); words2.add("привет");
unit.setLevel(true);
unit.setPriority(50); unit.setPriority(50);
unit.setKeyWords(words); unit.setKeyWords(words);
unit.setAnswer("Здравствуйте, вы написали в нашу компанию!"); unit.setAnswer("Здравствуйте, вы написали в нашу компанию!");
@ -123,7 +122,7 @@ public class AutoresponderTest {
} }
@Override @Override
public void addUnits(Collection<TextUnit> units) { public void addUnits(List<TextUnit> units) {
textUnits.addAll(units); textUnits.addAll(units);
} }
@ -131,9 +130,7 @@ public class AutoresponderTest {
public List<TextUnit> menuUnits() { public List<TextUnit> menuUnits() {
List<TextUnit> units = new ArrayList<>(); List<TextUnit> units = new ArrayList<>();
for (TextUnit textUnit : textUnits) { for (TextUnit textUnit : textUnits) {
if (textUnit.getLevel()) { units.add(textUnit);
units.add(textUnit);
}
} }
return units; return units;
} }