Skip to content

Commit d45b394

Browse files
ivicacmatijapetanjek
authored andcommitted
1132 - spotbugsMain + pmd + spotlessApply
1 parent 16f04e4 commit d45b394

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

server/libs/automation/automation-configuration/automation-configuration-rest/automation-configuration-rest-impl/src/test/java/com/bytechef/automation/configuration/web/rest/ProjectApiControllerIntTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.bytechef.platform.category.domain.Category;
3737
import com.bytechef.platform.category.service.CategoryService;
3838
import com.bytechef.platform.category.web.rest.model.CategoryModel;
39+
import com.bytechef.platform.configuration.web.rest.mapper.NotificationMapperImpl;
3940
import com.bytechef.platform.tag.domain.Tag;
4041
import com.bytechef.platform.tag.web.rest.model.TagModel;
4142
import com.bytechef.platform.tag.web.rest.model.UpdateTagsRequestModel;
@@ -70,6 +71,9 @@ public class ProjectApiControllerIntTest {
7071
@Autowired
7172
private MockMvc mockMvc;
7273

74+
@MockitoBean
75+
private NotificationMapperImpl notificationMapper;
76+
7377
@MockitoBean
7478
private ProjectDeploymentFacade projectDeploymentFacade;
7579

server/libs/automation/automation-configuration/automation-configuration-rest/automation-configuration-rest-impl/src/test/java/com/bytechef/automation/configuration/web/rest/WorkflowApiControllerIntTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.bytechef.platform.configuration.dto.WorkflowTaskDTO;
3434
import com.bytechef.platform.configuration.facade.ComponentConnectionFacade;
3535
import com.bytechef.platform.configuration.facade.WorkflowFacade;
36+
import com.bytechef.platform.configuration.web.rest.mapper.NotificationMapperImpl;
3637
import java.util.List;
3738
import org.junit.jupiter.api.Assertions;
3839
import org.junit.jupiter.api.BeforeEach;
@@ -68,6 +69,9 @@ public class WorkflowApiControllerIntTest {
6869
@Autowired
6970
private MockMvc mockMvc;
7071

72+
@MockitoBean
73+
private NotificationMapperImpl notificationMapper;
74+
7175
@MockitoBean
7276
private ProjectDeploymentFacade projectDeploymentFacade;
7377

server/libs/platform/platform-configuration/platform-configuration-api/src/main/java/com/bytechef/platform/configuration/notification/NotificationHandlerContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public String getJobName() {
7272

7373
private NotificationHandlerContext() {
7474

75-
};
75+
}
7676

7777
private Event.Type eventType;
7878
private Long jobId;

server/libs/platform/platform-configuration/platform-configuration-api/src/main/java/com/bytechef/platform/configuration/notification/NotificationSenderRegistry.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
* @author Matija Petanjek
2828
*/
2929
@Component
30-
public class NotificationSenderRegistry<T extends NotificationHandler> {
31-
private final Map<Notification.Type, NotificationSender<T>> notificationSenderMap;
30+
public class NotificationSenderRegistry {
31+
private final Map<Notification.Type, NotificationSender<?>> notificationSenderMap;
3232

33-
public NotificationSenderRegistry(List<NotificationSender<T>> notificationSenders) {
33+
public NotificationSenderRegistry(List<NotificationSender<?>> notificationSenders) {
3434
this.notificationSenderMap = MapUtils.toMap(
3535
notificationSenders, NotificationSender::getType, notificationSender -> notificationSender);
3636
}
3737

3838
@NonNull
39-
public NotificationSender<T> getNotificationSender(Notification.Type type) {
39+
public NotificationSender<?> getNotificationSender(Notification.Type type) {
4040
return notificationSenderMap.get(type);
4141
}
4242
}

server/libs/platform/platform-configuration/platform-configuration-service/src/test/java/com/bytechef/platform/configuration/service/NotificationServiceIntTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,24 @@
2323
import com.bytechef.platform.configuration.domain.Notification;
2424
import com.bytechef.platform.configuration.repository.EventRepository;
2525
import com.bytechef.platform.configuration.repository.NotificationRepository;
26+
import com.bytechef.platform.mail.MailService;
2627
import java.util.List;
2728
import java.util.Map;
2829
import org.junit.jupiter.api.AfterEach;
2930
import org.junit.jupiter.api.Test;
3031
import org.springframework.beans.factory.annotation.Autowired;
3132
import org.springframework.boot.test.context.SpringBootTest;
33+
import org.springframework.test.context.bean.override.mockito.MockitoBean;
3234

3335
/**
3436
* @author Matija Petanjek
3537
*/
3638
@SpringBootTest(classes = NotificationIntTestConfiguration.class)
3739
public class NotificationServiceIntTest {
3840

41+
@MockitoBean
42+
private MailService mailService;
43+
3944
@Autowired
4045
private EventRepository eventRepository;
4146

server/libs/platform/platform-coordinator/src/main/java/com/bytechef/platform/coordinator/event/listener/JobStatusApplicationEventListener.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,22 @@
2929
import com.bytechef.platform.configuration.notification.NotificationSender;
3030
import com.bytechef.platform.configuration.notification.NotificationSenderRegistry;
3131
import com.bytechef.platform.configuration.service.NotificationService;
32+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
3233
import java.util.List;
3334
import org.springframework.stereotype.Component;
3435

3536
/**
3637
* @author Matija Petanjek
3738
*/
3839
@Component
39-
@SuppressWarnings("unchecked")
4040
public class JobStatusApplicationEventListener implements ApplicationEventListener {
4141

4242
private final JobService jobService;
4343
private final NotificationHandlerRegistry notificationHandlerRegistry;
4444
private final NotificationSenderRegistry notificationSenderRegistry;
4545
private final NotificationService notificationService;
4646

47+
@SuppressFBWarnings("EI")
4748
public JobStatusApplicationEventListener(
4849
JobService jobService, NotificationHandlerRegistry notificationHandlerRegistry,
4950
NotificationSenderRegistry notificationSenderRegistry, NotificationService notificationService) {
@@ -55,6 +56,9 @@ public JobStatusApplicationEventListener(
5556

5657
}
5758

59+
@SuppressWarnings({
60+
"rawtypes", "unchecked"
61+
})
5862
public void onApplicationEvent(ApplicationEvent applicationEvent) {
5963
if (applicationEvent instanceof JobStatusApplicationEvent jobStatusApplicationEvent) {
6064

0 commit comments

Comments
 (0)