Skip to content

Commit

Permalink
Fix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Oct 23, 2023
1 parent 7664666 commit 98831a1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void assertHandleExceptionWithNoSign() {
}

private DingtalkJobErrorHandler getDingtalkJobErrorHandler(final Properties props) {
return (DingtalkJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "DINGTALK" , props);
return (DingtalkJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "DINGTALK", props);
}

private Properties createConfigurationProperties(final String webhook) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void assertHandleExceptionSucceedInSendingEmail() {
}

private EmailJobErrorHandler getEmailJobErrorHandler(final Properties props) {
return (EmailJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "EMAIL" , props);
return (EmailJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "EMAIL", props);
}

private void setUpMockSession(final Session session) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class JobErrorHandlerReloadable implements Reloadable<JobErrorHandl
@Override
public void init(final JobConfiguration jobConfig) {
props = (Properties) jobConfig.getProps().clone();
jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobConfig.getJobErrorHandlerType() , props);
jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobConfig.getJobErrorHandlerType(), props);
}

@Override
Expand All @@ -53,7 +53,7 @@ public synchronized void reloadIfNecessary(final JobConfiguration jobConfig) {
private void reload(final String jobErrorHandlerType, final Properties props) {
jobErrorHandler.close();
this.props = (Properties) props.clone();
jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobErrorHandlerType , props);
jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobErrorHandlerType, props);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class IgnoreJobErrorHandlerTest {

@Test
void assertHandleException() {
TypedSPILoader.getService(JobErrorHandler.class, "IGNORE" , new Properties()).handleException("test_job", new RuntimeException("test"));
TypedSPILoader.getService(JobErrorHandler.class, "IGNORE", new Properties()).handleException("test_job", new RuntimeException("test"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void setUp() {

@Test
void assertHandleException() {
LogJobErrorHandler actual = (LogJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "LOG" , new Properties());
LogJobErrorHandler actual = (LogJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "LOG", new Properties());
Throwable cause = new RuntimeException("test");
actual.handleException("test_job", cause);
assertThat(appenderList.size(), is(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ class ThrowJobErrorHandlerTest {

@Test
void assertHandleException() {
assertThrows(JobSystemException.class, () -> TypedSPILoader.getService(JobErrorHandler.class, "THROW" , new Properties()).handleException("test_job", new RuntimeException("test")));
assertThrows(JobSystemException.class, () -> TypedSPILoader.getService(JobErrorHandler.class, "THROW", new Properties()).handleException("test_job", new RuntimeException("test")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void assertHandleExceptionWithUrlIsNotFound() {
}

private WechatJobErrorHandler getWechatJobErrorHandler(final Properties props) {
return (WechatJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "WECHAT" , props);
return (WechatJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "WECHAT", props);
}

private Properties createConfigurationProperties(final String webhook) {
Expand Down

0 comments on commit 98831a1

Please sign in to comment.