-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change open sellorder implementation
- Loading branch information
Showing
9 changed files
with
251 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...om/ozgen/telegrambinancebot/scheduling/binance/BinanceNotCompletedSellOrderScheduler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.ozgen.telegrambinancebot.scheduling.binance; | ||
|
||
import com.ozgen.telegrambinancebot.manager.binance.BinanceOpenSellOrderManager; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class BinanceNotCompletedSellOrderScheduler { | ||
|
||
private final BinanceOpenSellOrderManager binanceOpenSellOrderManager; | ||
|
||
|
||
@Scheduled(fixedRateString = "#{${app.bot.schedule.openSellOrder}}") | ||
public void processNotCompletedSellOrders() { | ||
log.info("NotCompletedSellOrderScheduler has been started"); | ||
this.binanceOpenSellOrderManager.processNotCompletedSellOrders(); | ||
log.info("NotCompletedSellOrderScheduler has been finished"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...zgen/telegrambinancebot/scheduling/binance/BinanceNotCompletedSellOrderSchedulerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.ozgen.telegrambinancebot.scheduling.binance; | ||
|
||
import com.ozgen.telegrambinancebot.manager.binance.BinanceOpenSellOrderManager; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.MockitoAnnotations; | ||
|
||
import static org.mockito.Mockito.verify; | ||
|
||
|
||
public class BinanceNotCompletedSellOrderSchedulerTest { | ||
|
||
@Mock | ||
private BinanceOpenSellOrderManager binanceOpenSellOrderManager; | ||
|
||
@InjectMocks | ||
private BinanceNotCompletedSellOrderScheduler binanceNotCompletedSellOrderScheduler; | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
MockitoAnnotations.initMocks(this); | ||
} | ||
|
||
@Test | ||
public void testProcessOpenSellOrders() { | ||
this.binanceNotCompletedSellOrderScheduler.processNotCompletedSellOrders(); | ||
|
||
verify(this.binanceOpenSellOrderManager) | ||
.processNotCompletedSellOrders(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters