Skip to content

Commit aa3db31

Browse files
BerndBreierignaciorecuerda
authored andcommitted
TSK-775 part2 correct missing adaptions to checkstyle template
1 parent 8789dd5 commit aa3db31

35 files changed

+799
-609
lines changed

rest/taskana-history-rest-spring/src/main/java/pro/taskana/rest/TaskHistoryEventController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public TaskHistoryEventController(TaskanaEngineConfiguration taskanaEngineConfig
100100
@Transactional(readOnly = true, rollbackFor = Exception.class)
101101
public ResponseEntity<PagedResources<TaskHistoryEventResource>> getTaskHistoryEvent(
102102
@RequestParam MultiValueMap<String, String> params) throws InvalidArgumentException {
103-
if(LOGGER.isDebugEnabled()) {
103+
if (LOGGER.isDebugEnabled()) {
104104
LOGGER.debug("Entry to getTaskHistoryEvent(params= {})", LoggerUtils.mapToString(params));
105105
}
106106

@@ -129,7 +129,7 @@ public ResponseEntity<PagedResources<TaskHistoryEventResource>> getTaskHistoryEv
129129
TaskHistoryEventListAssembler assembler = new TaskHistoryEventListAssembler();
130130
PagedResources<TaskHistoryEventResource> pagedResources = assembler.toResources(historyEvents, pageMetadata);
131131

132-
if(LOGGER.isDebugEnabled()) {
132+
if (LOGGER.isDebugEnabled()) {
133133
LOGGER.debug("Exit from getTaskHistoryEvent(), returning {}", new ResponseEntity<>(pagedResources, HttpStatus.OK));
134134
}
135135

@@ -138,7 +138,7 @@ public ResponseEntity<PagedResources<TaskHistoryEventResource>> getTaskHistoryEv
138138

139139
private HistoryQuery applySortingParams(HistoryQuery query, MultiValueMap<String, String> params)
140140
throws IllegalArgumentException, InvalidArgumentException {
141-
if(LOGGER.isDebugEnabled()) {
141+
if (LOGGER.isDebugEnabled()) {
142142
LOGGER.debug("Entry to applySortingParams(params= {})", LoggerUtils.mapToString(params));
143143
}
144144

@@ -217,7 +217,7 @@ private HistoryQuery applySortingParams(HistoryQuery query, MultiValueMap<String
217217
}
218218
params.remove(SORT_BY);
219219
params.remove(SORT_DIRECTION);
220-
if(LOGGER.isDebugEnabled()) {
220+
if (LOGGER.isDebugEnabled()) {
221221
LOGGER.debug("Exit from applySortingParams(), returning {}", query);
222222
}
223223

@@ -226,7 +226,7 @@ private HistoryQuery applySortingParams(HistoryQuery query, MultiValueMap<String
226226

227227
private HistoryQuery applyFilterParams(HistoryQuery query,
228228
MultiValueMap<String, String> params) {
229-
if(LOGGER.isDebugEnabled()) {
229+
if (LOGGER.isDebugEnabled()) {
230230
LOGGER.debug("Entry to applyFilterParams(query= {}, params= {})", query, params);
231231
}
232232

@@ -404,7 +404,7 @@ private HistoryQuery applyFilterParams(HistoryQuery query,
404404
query.custom4Like(LIKE + params.get(CUSTOM_4_LIKE).get(0) + LIKE);
405405
params.remove(CUSTOM_4_LIKE);
406406
}
407-
if(LOGGER.isDebugEnabled()) {
407+
if (LOGGER.isDebugEnabled()) {
408408
LOGGER.debug("Exit from applyFilterParams(), returning {}", query);
409409
}
410410

rest/taskana-history-rest-spring/src/main/java/pro/taskana/rest/resource/TaskHistoryEventResource.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -247,20 +247,20 @@ public void setNewData(String newData) {
247247

248248
@Override
249249
public String toString() {
250-
return "TaskHistoryEventResource [" +
251-
"taskHistoryEventId= " + this.taskHistoryEventId +
252-
"businessProcessId= " + this.businessProcessId +
253-
"parentBusinessProcessId= " + this.parentBusinessProcessId +
254-
"taskId= " + this.taskId +
255-
"eventType= " + this.eventType +
256-
"created= " + this.created +
257-
"userId= " + this.userId +
258-
"domain= " + this.domain +
259-
"workbasketKey= " + this.workbasketKey +
260-
"oldValue= " + this.oldValue +
261-
"newValue= " + this.newValue +
262-
"oldData= " + this.oldData +
263-
"newData= " + this.newData +
264-
"]";
250+
return "TaskHistoryEventResource ["
251+
+ "taskHistoryEventId= " + this.taskHistoryEventId
252+
+ "businessProcessId= " + this.businessProcessId
253+
+ "parentBusinessProcessId= " + this.parentBusinessProcessId
254+
+ "taskId= " + this.taskId
255+
+ "eventType= " + this.eventType
256+
+ "created= " + this.created
257+
+ "userId= " + this.userId
258+
+ "domain= " + this.domain
259+
+ "workbasketKey= " + this.workbasketKey
260+
+ "oldValue= " + this.oldValue
261+
+ "newValue= " + this.newValue
262+
+ "oldData= " + this.oldData
263+
+ "newData= " + this.newData
264+
+ "]";
265265
}
266266
}

rest/taskana-history-rest-spring/src/main/java/pro/taskana/rest/sampledata/SampleDataGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ public void generateSampleData(String schemaName) {
6767
}
6868

6969
private StringReader selectSchemaScript(String dbProductName, String schemaName) {
70-
return new StringReader("PostgreSQL".equals(dbProductName) ?
71-
"SET search_path TO " + schemaName + ";" :
72-
"SET SCHEMA " + schemaName + ";");
70+
return new StringReader("PostgreSQL".equals(dbProductName)
71+
? "SET search_path TO " + schemaName + ";"
72+
: "SET SCHEMA " + schemaName + ";");
7373
}
7474

7575
}

rest/taskana-history-rest-spring/src/test/java/pro/taskana/historyPlugin/doc/api/TaskHistoryEventControllerRestDocumentation.java

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
import pro.taskana.historyPlugin.config.TaskHistoryRestConfiguration;
3232
import pro.taskana.rest.RestConfiguration;
3333

34+
/**
35+
* Controller for Rest documentation.
36+
*/
3437
@RunWith(SpringRunner.class)
3538
@SpringBootTest(classes = {RestConfiguration.class, TaskHistoryRestConfiguration.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
3639
public class TaskHistoryEventControllerRestDocumentation {
@@ -64,36 +67,36 @@ public void setUp() {
6467
.withRequestDefaults(prettyPrint()))
6568
.build();
6669

67-
taskHistoryEventFieldDescriptionsMap.put("_embedded.taskHistoryId","Unique ID");
68-
taskHistoryEventFieldDescriptionsMap.put("_embedded.businessProcessId","The id of the business process");
69-
taskHistoryEventFieldDescriptionsMap.put("_embedded.parentBusinessProcessId","The id of the parent business process");
70-
taskHistoryEventFieldDescriptionsMap.put("_embedded.taskId","The id of the task");
71-
taskHistoryEventFieldDescriptionsMap.put("_embedded.eventType","The type of the event");
72-
taskHistoryEventFieldDescriptionsMap.put("_embedded.created","The time was created");
73-
taskHistoryEventFieldDescriptionsMap.put("_embedded.userId","The id of the user");
74-
taskHistoryEventFieldDescriptionsMap.put("_embedded.domain","Domain");
75-
taskHistoryEventFieldDescriptionsMap.put("_embedded.workbasketKey","The key of workbasket");
76-
taskHistoryEventFieldDescriptionsMap.put("_embedded.porCompany","");
77-
taskHistoryEventFieldDescriptionsMap.put("_embedded.porSystem","");
78-
taskHistoryEventFieldDescriptionsMap.put("_embedded.porInstance","");
79-
taskHistoryEventFieldDescriptionsMap.put("_embedded.porValue","");
80-
taskHistoryEventFieldDescriptionsMap.put("_embedded.porType","");
81-
taskHistoryEventFieldDescriptionsMap.put("_embedded.taskClassificationKey","The key of classification task");
82-
taskHistoryEventFieldDescriptionsMap.put("_embedded.taskClassificationCategory","The category of classification");
83-
taskHistoryEventFieldDescriptionsMap.put("_embedded.attachmentClassificationKey","");
84-
taskHistoryEventFieldDescriptionsMap.put("_embedded.comment","");
85-
taskHistoryEventFieldDescriptionsMap.put("_embedded.oldValue","The old value");
86-
taskHistoryEventFieldDescriptionsMap.put("_embedded.newValue","The new value");
87-
taskHistoryEventFieldDescriptionsMap.put("_embedded.custom1","A custom property with name \"1\"");
88-
taskHistoryEventFieldDescriptionsMap.put("_embedded.custom2","A custom property with name \"2\"");
89-
taskHistoryEventFieldDescriptionsMap.put("_embedded.custom3","A custom property with name \"3\"");
90-
taskHistoryEventFieldDescriptionsMap.put("_embedded.custom4","A custom property with name \"4\"");
91-
taskHistoryEventFieldDescriptionsMap.put("_embedded.oldData","The old data");
92-
taskHistoryEventFieldDescriptionsMap.put("_embedded.newData","The new data");
93-
taskHistoryEventFieldDescriptionsMap.put("_links.self.href","The links of this task history event");
94-
taskHistoryEventFieldDescriptionsMap.put("_links.allTaskHistoryEvent.href","Link to all task history event");
95-
taskHistoryEventFieldDescriptionsMap.put("_links.first.href","Link to the first result");
96-
taskHistoryEventFieldDescriptionsMap.put("_links.last.href","Link to the last result");
70+
taskHistoryEventFieldDescriptionsMap.put("_embedded.taskHistoryId", "Unique ID");
71+
taskHistoryEventFieldDescriptionsMap.put("_embedded.businessProcessId", "The id of the business process");
72+
taskHistoryEventFieldDescriptionsMap.put("_embedded.parentBusinessProcessId", "The id of the parent business process");
73+
taskHistoryEventFieldDescriptionsMap.put("_embedded.taskId", "The id of the task");
74+
taskHistoryEventFieldDescriptionsMap.put("_embedded.eventType", "The type of the event");
75+
taskHistoryEventFieldDescriptionsMap.put("_embedded.created", "The time was created");
76+
taskHistoryEventFieldDescriptionsMap.put("_embedded.userId", "The id of the user");
77+
taskHistoryEventFieldDescriptionsMap.put("_embedded.domain", "Domain");
78+
taskHistoryEventFieldDescriptionsMap.put("_embedded.workbasketKey", "The key of workbasket");
79+
taskHistoryEventFieldDescriptionsMap.put("_embedded.porCompany", "");
80+
taskHistoryEventFieldDescriptionsMap.put("_embedded.porSystem", "");
81+
taskHistoryEventFieldDescriptionsMap.put("_embedded.porInstance", "");
82+
taskHistoryEventFieldDescriptionsMap.put("_embedded.porValue", "");
83+
taskHistoryEventFieldDescriptionsMap.put("_embedded.porType", "");
84+
taskHistoryEventFieldDescriptionsMap.put("_embedded.taskClassificationKey", "The key of classification task");
85+
taskHistoryEventFieldDescriptionsMap.put("_embedded.taskClassificationCategory", "The category of classification");
86+
taskHistoryEventFieldDescriptionsMap.put("_embedded.attachmentClassificationKey", "");
87+
taskHistoryEventFieldDescriptionsMap.put("_embedded.comment", "");
88+
taskHistoryEventFieldDescriptionsMap.put("_embedded.oldValue", "The old value");
89+
taskHistoryEventFieldDescriptionsMap.put("_embedded.newValue", "The new value");
90+
taskHistoryEventFieldDescriptionsMap.put("_embedded.custom1", "A custom property with name \"1\"");
91+
taskHistoryEventFieldDescriptionsMap.put("_embedded.custom2", "A custom property with name \"2\"");
92+
taskHistoryEventFieldDescriptionsMap.put("_embedded.custom3", "A custom property with name \"3\"");
93+
taskHistoryEventFieldDescriptionsMap.put("_embedded.custom4", "A custom property with name \"4\"");
94+
taskHistoryEventFieldDescriptionsMap.put("_embedded.oldData", "The old data");
95+
taskHistoryEventFieldDescriptionsMap.put("_embedded.newData", "The new data");
96+
taskHistoryEventFieldDescriptionsMap.put("_links.self.href", "The links of this task history event");
97+
taskHistoryEventFieldDescriptionsMap.put("_links.allTaskHistoryEvent.href", "Link to all task history event");
98+
taskHistoryEventFieldDescriptionsMap.put("_links.first.href", "Link to the first result");
99+
taskHistoryEventFieldDescriptionsMap.put("_links.last.href", "Link to the last result");
97100

98101
allTaskHistoryEventFieldDescriptors = new FieldDescriptor[] {
99102
subsectionWithPath("_embedded.taskHistoryEventResourceList").description("An array of Task history event"),

rest/taskana-history-rest-spring/src/test/java/pro/taskana/historyPlugin/rest/TaskHistoryEventControllerIntTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
import pro.taskana.rest.RestConfiguration;
3838
import pro.taskana.rest.resource.TaskHistoryEventResource;
3939

40+
/**
41+
* Controller for integration test.
42+
*/
43+
4044
@RunWith(SpringRunner.class)
4145
@SpringBootTest(classes = {RestConfiguration.class, TaskHistoryRestConfiguration.class},
4246
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {"devMode=true"})
@@ -138,7 +142,7 @@ public void testGetSecondPageSortedByKey() {
138142
}
139143

140144
/**
141-
* Return a REST template which is capable of dealing with responses in HAL format
145+
* Return a REST template which is capable of dealing with responses in HAL format.
142146
*
143147
* @return RestTemplate
144148
*/

rest/taskana-rest-spring-example/.project

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@
1515
<arguments>
1616
</arguments>
1717
</buildCommand>
18+
<buildCommand>
19+
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
1823
</buildSpec>
1924
<natures>
2025
<nature>org.eclipse.jdt.core.javanature</nature>
2126
<nature>org.eclipse.m2e.core.maven2Nature</nature>
27+
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
2228
</natures>
2329
</projectDescription>

rest/taskana-rest-spring-example/src/main/java/pro/taskana/ldap/LdapCacheTestImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ private void addUsersToGroups() {
362362
case 3:
363363
group3.add(group);
364364
break;
365+
default:
366+
break;
365367
}
366368
groupNumber = (groupNumber + 1) % 4;
367369
}
@@ -382,6 +384,8 @@ private void addUsersToGroups() {
382384
case 3:
383385
users.put(item, group3);
384386
break;
387+
default:
388+
break;
385389
}
386390
}
387391
countUser = (countUser + 1) % 4;

rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/ExampleRestApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ExampleRestApplication {
4343

4444
@Autowired
4545
private SampleDataGenerator sampleDataGenerator;
46-
46+
4747
@Autowired
4848
private LdapClient ldapClient;
4949

@@ -85,7 +85,7 @@ private void init() {
8585
AccessIdController.setLdapCache(ldapCacheTest);
8686
}
8787
if (generateSampleData) {
88-
sampleDataGenerator.generateSampleData(schemaName);
88+
sampleDataGenerator.generateSampleData(schemaName);
8989
}
9090
}
9191
}

rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/WebMvcConfig.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414

1515
import com.fasterxml.jackson.databind.ObjectMapper;
1616
import com.fasterxml.jackson.databind.SerializationFeature;
17-
17+
/**
18+
* The Web MVC Configuration.
19+
*
20+
*/
1821
@Configuration
1922
@EnableWebMvc
2023
public class WebMvcConfig implements WebMvcConfigurer {

rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/controllers/LoginController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
88
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
99

10+
/**
11+
* The login controller.
12+
*/
1013
@Controller
1114
public class LoginController implements WebMvcConfigurer {
1215
private static final Logger LOGGER = LoggerFactory.getLogger(LoginController.class);

rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/controllers/ViewController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import org.springframework.stereotype.Controller;
44
import org.springframework.web.bind.annotation.RequestMapping;
55

6+
/**
7+
* The view controller.
8+
*/
69
@Controller
710
public class ViewController {
811

rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/models/User.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package pro.taskana.rest.models;
2-
2+
/**
3+
* model for a user.
4+
*
5+
*/
36
public class User {
47

58
private String username;

rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
import javax.security.auth.callback.PasswordCallback;
1111
import javax.security.auth.spi.LoginModule;
1212

13-
import org.springframework.beans.factory.annotation.Autowired;
1413
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
15-
import org.springframework.stereotype.Component;
1614

1715
import pro.taskana.ldap.LdapCacheTestImpl;
1816
import pro.taskana.rest.resource.AccessIdResource;

rest/taskana-rest-spring-example/src/test/java/pro/taskana/doc/api/AbstractPagingControllerRestDocumentation.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,42 @@
2929

3030
import java.util.HashMap;
3131

32+
/**
33+
* Generate Rest Docu for AbstractPagingController.
34+
*/
3235
@RunWith(SpringRunner.class)
3336
@SpringBootTest(classes = RestConfiguration.class, webEnvironment = WebEnvironment.RANDOM_PORT)
3437
public class AbstractPagingControllerRestDocumentation {
35-
38+
3639
@LocalServerPort
3740
int port;
38-
41+
3942
@Rule
4043
public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
41-
44+
4245
@Autowired
4346
private WebApplicationContext context;
44-
47+
4548
private MockMvc mockMvc;
4649

4750
private HashMap<String, String> pagingFieldDescriptionsMap = new HashMap<String, String>();
48-
51+
4952
private FieldDescriptor[] pagingFieldDescriptors;
50-
53+
5154
@Before
5255
public void setUp() {
5356
document("{methodName}",
5457
preprocessRequest(prettyPrint()),
5558
preprocessResponse(prettyPrint()));
56-
59+
5760
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
5861
.apply(springSecurity())
5962
.apply(documentationConfiguration(this.restDocumentation)
6063
.operationPreprocessors()
6164
.withResponseDefaults(prettyPrint())
6265
.withRequestDefaults(prettyPrint()))
6366
.build();
64-
67+
6568
pagingFieldDescriptionsMap.put("page", "Contains metainfo if there are multiple pages, else it is null");
6669
pagingFieldDescriptionsMap.put("page.size", "Number of items per page");
6770
pagingFieldDescriptionsMap.put("page.totalElements", "Total number of items");
@@ -71,10 +74,10 @@ public void setUp() {
7174
pagingFieldDescriptionsMap.put("_links.first.href", "Link to first page");
7275
pagingFieldDescriptionsMap.put("_links.last.href", "Link to last page");
7376
pagingFieldDescriptionsMap.put("_links.prev.href", "Link to previous page");
74-
pagingFieldDescriptionsMap.put("_links.next.href", "Link to next page");
75-
77+
pagingFieldDescriptionsMap.put("_links.next.href", "Link to next page");
78+
7679
pagingFieldDescriptors = new FieldDescriptor[] {
77-
80+
7881
subsectionWithPath("_embedded.classificationSummaryResourceList").ignored(),
7982
fieldWithPath("_links").ignored(),
8083
fieldWithPath("_links.self").ignored(),
@@ -91,7 +94,7 @@ public void setUp() {
9194
fieldWithPath("_links.next.href").description(pagingFieldDescriptionsMap.get("_links.next.href"))
9295
};
9396
}
94-
97+
9598
@Test
9699
public void commonSummaryResourceFieldsDocTest() throws Exception {
97100
this.mockMvc.perform(RestDocumentationRequestBuilders

rest/taskana-rest-spring-example/src/test/java/pro/taskana/doc/api/ClassificationControllerRestDocumentation.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
import org.springframework.web.context.WebApplicationContext;
3939

4040
import pro.taskana.rest.RestConfiguration;
41-
41+
/**
42+
* Generate REST Dokumentation for ClassificationController.
43+
*
44+
*/
4245
@RunWith(SpringRunner.class)
4346
@SpringBootTest(classes = RestConfiguration.class, webEnvironment = WebEnvironment.RANDOM_PORT)
4447
public class ClassificationControllerRestDocumentation {

0 commit comments

Comments
 (0)