Skip to content

Commit

Permalink
#34 renamed from SlackAPI to SlackAPIClient
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayNN committed Jan 8, 2018
1 parent cb84d46 commit 6c1611a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.List;

@SpringBootApplication
@EnableScheduling
public class Application {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package juja.microservices.slack.archive;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

@Configuration
@EnableScheduling
public class SchedulerConfig implements SchedulingConfigurer {

private final int POOL_SIZE = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.util.List;

public interface SlackApi {
public interface SlackApiClient {

List<ChannelDTO> receiveChannelsList();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@Repository
@Slf4j
public class SlackApiImpl implements SlackApi {
public class SlackApiClientImpl implements SlackApiClient {

private final RestTemplate restTemplate;

Expand All @@ -23,7 +23,7 @@ public class SlackApiImpl implements SlackApi {
@Value("${slack.api.channels.urltemplate}")
private String slackApiChannelsUrlTemplate;

public SlackApiImpl(RestTemplate restTemplate) {
public SlackApiClientImpl(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package juja.microservices.slack.archive.service.impl;

import juja.microservices.slack.archive.model.dto.ChannelDTO;
import juja.microservices.slack.archive.api.SlackApi;
import juja.microservices.slack.archive.api.SlackApiClient;
import juja.microservices.slack.archive.service.SlackApiService;
import org.springframework.stereotype.Service;

Expand All @@ -10,14 +10,14 @@
@Service
public class SlackApiServiceImpl implements SlackApiService {

private SlackApi slackApi;
private SlackApiClient slackApiClient;

public SlackApiServiceImpl(SlackApi slackApi) {
this.slackApi = slackApi;
public SlackApiServiceImpl(SlackApiClient slackApiClient) {
this.slackApiClient = slackApiClient;
}

@Override
public List<ChannelDTO> receiveChannels() {
return slackApi.receiveChannelsList();
return slackApiClient.receiveChannelsList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

@RunWith(SpringRunner.class)
@SpringBootTest
public class SlackApiImplTest {
public class SlackApiClientImplTest {

@Inject
private RestTemplate restTemplate;
@Inject
private SlackApi slackApi;
private SlackApiClient slackApiClient;
private MockRestServiceServer mockServer;
@Value("${slack.api.token}")
private String slackApiToken;
Expand All @@ -54,7 +54,7 @@ public void receiveChannelsList() throws Exception {
.andExpect(method(HttpMethod.GET))
.andRespond(withSuccess(Util.readStringFromFile("api/channels.json"), MediaType.APPLICATION_JSON));

List<ChannelDTO> result = slackApi.receiveChannelsList();
List<ChannelDTO> result = slackApiClient.receiveChannelsList();

assertEquals(expectedChannels, result);
}
Expand Down

0 comments on commit 6c1611a

Please sign in to comment.