TSK-1775: reformatted entire backend code base

with new formatter
This commit is contained in:
Mustapha Zorgati 2021-11-24 18:25:35 +01:00
parent 3c86ff2969
commit c7742b3056
14 changed files with 23 additions and 48 deletions

View File

@ -12,5 +12,4 @@ public class SystemException extends TaskanaRuntimeException {
public SystemException(String msg, Throwable cause) { public SystemException(String msg, Throwable cause) {
super(msg, ErrorCode.of(ERROR_KEY), cause); super(msg, ErrorCode.of(ERROR_KEY), cause);
} }
} }

View File

@ -24,11 +24,11 @@ import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEventType;
class LogfileHistoryServiceImplTest { class LogfileHistoryServiceImplTest {
static TaskanaEngine taskanaEngineMock;
private final ObjectMapper objectMapper = new ObjectMapper().registerModule(new JavaTimeModule()); private final ObjectMapper objectMapper = new ObjectMapper().registerModule(new JavaTimeModule());
private final LogfileHistoryServiceImpl logfileHistoryServiceImpl = private final LogfileHistoryServiceImpl logfileHistoryServiceImpl =
new LogfileHistoryServiceImpl(); new LogfileHistoryServiceImpl();
private final TestLogger logger = TestLoggerFactory.getTestLogger("AUDIT"); private final TestLogger logger = TestLoggerFactory.getTestLogger("AUDIT");
static TaskanaEngine taskanaEngineMock;
@AfterEach @AfterEach
public void clearLoggers() { public void clearLoggers() {

View File

@ -82,8 +82,7 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
private String[] custom3Like; private String[] custom3Like;
private String[] custom4Like; private String[] custom4Like;
public TaskHistoryQueryImpl( public TaskHistoryQueryImpl(TaskanaHistoryEngineImpl taskanaHistoryEngine) {
TaskanaHistoryEngineImpl taskanaHistoryEngine) {
this.taskanaHistoryEngine = taskanaHistoryEngine; this.taskanaHistoryEngine = taskanaHistoryEngine;
this.orderBy = new ArrayList<>(); this.orderBy = new ArrayList<>();
this.orderColumns = new ArrayList<>(); this.orderColumns = new ArrayList<>();
@ -266,7 +265,6 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
return custom4Like; return custom4Like;
} }
@Override @Override
public TaskHistoryQuery idIn(String... idIn) { public TaskHistoryQuery idIn(String... idIn) {
this.idIn = toUpperCopy(idIn); this.idIn = toUpperCopy(idIn);

View File

@ -501,9 +501,7 @@ class QueryTaskHistoryAccTest extends AbstractAccTest {
.list(); .list();
assertThat(taskHistoryEvents).hasSize(1); assertThat(taskHistoryEvents).hasSize(1);
assertThat(taskHistoryEvents.get(0)) assertThat(taskHistoryEvents.get(0)).extracting(TaskHistoryEvent::getUserLongName).isNull();
.extracting(TaskHistoryEvent::getUserLongName)
.isNull();
} }
@WithAccessId(user = "user-1-1") @WithAccessId(user = "user-1-1")
@ -533,8 +531,6 @@ class QueryTaskHistoryAccTest extends AbstractAccTest {
.list(); .list();
assertThat(taskHistoryEvents).hasSize(1); assertThat(taskHistoryEvents).hasSize(1);
assertThat(taskHistoryEvents.get(0)) assertThat(taskHistoryEvents.get(0)).extracting(TaskHistoryEvent::getUserLongName).isNull();
.extracting(TaskHistoryEvent::getUserLongName)
.isNull();
} }
} }

View File

@ -13,12 +13,12 @@ import pro.taskana.common.internal.transaction.TaskanaTransactionProvider;
/** Abstract base for all background jobs of TASKANA. */ /** Abstract base for all background jobs of TASKANA. */
public abstract class AbstractTaskanaJob implements TaskanaJob { public abstract class AbstractTaskanaJob implements TaskanaJob {
protected Instant firstRun;
protected Duration runEvery;
protected final TaskanaEngineImpl taskanaEngineImpl; protected final TaskanaEngineImpl taskanaEngineImpl;
protected final TaskanaTransactionProvider txProvider; protected final TaskanaTransactionProvider txProvider;
protected final ScheduledJob scheduledJob; protected final ScheduledJob scheduledJob;
private final boolean async; private final boolean async;
protected Instant firstRun;
protected Duration runEvery;
protected AbstractTaskanaJob( protected AbstractTaskanaJob(
TaskanaEngine taskanaEngine, TaskanaEngine taskanaEngine,

View File

@ -51,7 +51,6 @@ public interface TaskCommentQuery extends BaseQuery<TaskComment, TaskCommentQuer
*/ */
TaskCommentQuery taskIdIn(String... taskIds); TaskCommentQuery taskIdIn(String... taskIds);
/** /**
* Add your texts for pattern matching to your query. It will be compared in SQL with the LIKE * Add your texts for pattern matching to your query. It will be compared in SQL with the LIKE
* operator. You may use a wildcard like % to specify the pattern. If you specify multiple * operator. You may use a wildcard like % to specify the pattern. If you specify multiple

View File

@ -3,7 +3,6 @@ package pro.taskana.task.api;
import pro.taskana.common.api.QueryColumnName; import pro.taskana.common.api.QueryColumnName;
public enum TaskCommentQueryColumnName implements QueryColumnName { public enum TaskCommentQueryColumnName implements QueryColumnName {
ID("tc.id"), ID("tc.id"),
TASK_ID("tc.task_id"), TASK_ID("tc.task_id"),
TEXT_FIELD("tc.text_field"), TEXT_FIELD("tc.text_field"),
@ -22,6 +21,4 @@ public enum TaskCommentQueryColumnName implements QueryColumnName {
public String toString() { public String toString() {
return name; return name;
} }
} }

View File

@ -385,8 +385,7 @@ public class TaskServiceImpl implements TaskService {
@Override @Override
public TaskCommentQuery createTaskCommentQuery() { public TaskCommentQuery createTaskCommentQuery() {
return new TaskCommentQueryImpl( return new TaskCommentQueryImpl(taskanaEngine);
taskanaEngine);
} }
@Override @Override

View File

@ -11,14 +11,14 @@ public interface User {
String getId(); String getId();
/** /**
* Sets the id of the User. * Sets the id of the User.
* *
* @param id the id of the User * @param id the id of the User
*/ */
void setId(String id); void setId(String id);
/** /**
* Gets the first name of the User. * Gets the first name of the User.
* *
* @return firstName * @return firstName
*/ */
@ -46,7 +46,7 @@ public interface User {
void setLastName(String lastName); void setLastName(String lastName);
/** /**
* Gets the full name of the User. * Gets the full name of the User.
* *
* @return fullName * @return fullName
*/ */
@ -60,7 +60,7 @@ public interface User {
void setFullName(String fullName); void setFullName(String fullName);
/** /**
* Gets the long name of the User. * Gets the long name of the User.
* *
* @return longName * @return longName
*/ */
@ -88,7 +88,7 @@ public interface User {
void setEmail(String email); void setEmail(String email);
/** /**
* Gets the phone number of the User. * Gets the phone number of the User.
* *
* @return phone * @return phone
*/ */
@ -102,7 +102,7 @@ public interface User {
void setPhone(String phone); void setPhone(String phone);
/** /**
* Gets the mobile phone number of the User. * Gets the mobile phone number of the User.
* *
* @return mobilePhone * @return mobilePhone
*/ */
@ -116,7 +116,7 @@ public interface User {
void setMobilePhone(String mobilePhone); void setMobilePhone(String mobilePhone);
/** /**
* Gets the orgLevel4 of the User. * Gets the orgLevel4 of the User.
* *
* @return orgLevel4 * @return orgLevel4
*/ */
@ -130,7 +130,7 @@ public interface User {
void setOrgLevel4(String orgLevel4); void setOrgLevel4(String orgLevel4);
/** /**
* Gets the orgLevel3 of the User. * Gets the orgLevel3 of the User.
* *
* @return orgLevel3 * @return orgLevel3
*/ */
@ -144,7 +144,7 @@ public interface User {
void setOrgLevel3(String orgLevel3); void setOrgLevel3(String orgLevel3);
/** /**
* Gets the orgLevel2 of the User. * Gets the orgLevel2 of the User.
* *
* @return orgLevel2 * @return orgLevel2
*/ */
@ -158,7 +158,7 @@ public interface User {
void setOrgLevel2(String orgLevel2); void setOrgLevel2(String orgLevel2);
/** /**
* Gets the orgLevel1 of the User. * Gets the orgLevel1 of the User.
* *
* @return orgLevel1 * @return orgLevel1
*/ */
@ -172,7 +172,7 @@ public interface User {
void setOrgLevel1(String orgLevel1); void setOrgLevel1(String orgLevel1);
/** /**
* Gets the data of the User. * Gets the data of the User.
* *
* @return data * @return data
*/ */
@ -186,5 +186,4 @@ public interface User {
void setData(String data); void setData(String data);
User copy(); User copy();
} }

View File

@ -100,12 +100,8 @@ class GetTaskAccTest extends AbstractAccTest {
Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
String userLongName = String userLongName = taskanaEngine.getUserService().getUser(task.getOwner()).getLongName();
taskanaEngine.getUserService().getUser(task.getOwner()).getLongName(); assertThat(task).extracting(Task::getOwnerLongName).isEqualTo(userLongName);
assertThat(task)
.extracting(Task::getOwnerLongName)
.isEqualTo(userLongName);
} }
@WithAccessId(user = "admin") @WithAccessId(user = "admin")
@ -117,10 +113,7 @@ class GetTaskAccTest extends AbstractAccTest {
Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
assertThat(task) assertThat(task).extracting(Task::getOwnerLongName).isNull();
.extracting(Task::getOwnerLongName)
.isNull();
} }
@WithAccessId(user = "user-1-2") @WithAccessId(user = "user-1-2")

View File

@ -5,5 +5,4 @@ import pro.taskana.TaskanaEngineConfiguration;
public interface TaskanaEngineConfigurationModifier { public interface TaskanaEngineConfigurationModifier {
void modify(TaskanaEngineConfiguration taskanaEngineConfiguration); void modify(TaskanaEngineConfiguration taskanaEngineConfiguration);
} }

View File

@ -460,5 +460,4 @@ public class ReportFilterParameter {
this.custom16Like = custom16Like; this.custom16Like = custom16Like;
this.custom16NotIn = custom16NotIn; this.custom16NotIn = custom16NotIn;
} }
} }

View File

@ -17,7 +17,6 @@ public interface DmnValidator {
* Validates a DmnModelInstance. * Validates a DmnModelInstance.
* *
* @param dmnModelInstance the DMN model to validate * @param dmnModelInstance the DMN model to validate
*
*/ */
void validate(DmnModelInstance dmnModelInstance); void validate(DmnModelInstance dmnModelInstance);
} }

View File

@ -8,12 +8,10 @@ import pro.taskana.routing.dmn.spi.api.DmnValidator;
public class TestDmnValidatorImpl implements DmnValidator { public class TestDmnValidatorImpl implements DmnValidator {
@Override @Override
public void initialize(TaskanaEngine taskanaEngine) { public void initialize(TaskanaEngine taskanaEngine) {}
}
@Override @Override
public void validate(DmnModelInstance dmnModelInstance) { public void validate(DmnModelInstance dmnModelInstance) {
//custom validation logic // custom validation logic
} }
} }