-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(kotlin): migration of the HibernateSearchIndexation to Kotlin
- Loading branch information
1 parent
59de549
commit edb8fc9
Showing
4 changed files
with
44 additions
and
49 deletions.
There are no files selected for viewing
22 changes: 0 additions & 22 deletions
22
backend/src/main/java/lan/dk/podcastserver/scheduled/HibernateSearchIndexation.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...rc/main/kotlin/com/github/davinkevin/podcastserver/scheduled/HibernateSearchIndexation.kt
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,16 @@ | ||
package com.github.davinkevin.podcastserver.scheduled | ||
|
||
import lan.dk.podcastserver.business.ItemBusiness | ||
import org.springframework.scheduling.annotation.Scheduled | ||
import org.springframework.stereotype.Component | ||
|
||
/** | ||
* Created by kevin on 22/08/2014. | ||
*/ | ||
@Component | ||
class HibernateSearchIndexation(private val itemBusiness: ItemBusiness) { | ||
|
||
@Scheduled(fixedDelay = 86400000) | ||
fun refreshIndex() = itemBusiness.reindex() | ||
|
||
} |
27 changes: 0 additions & 27 deletions
27
backend/src/test/java/lan/dk/podcastserver/scheduled/HibernateSearchIndexationTest.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...est/kotlin/com/github/davinkevin/podcastserver/scheduled/HibernateSearchIndexationTest.kt
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,28 @@ | ||
package com.github.davinkevin.podcastserver.scheduled | ||
|
||
import lan.dk.podcastserver.business.ItemBusiness | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.ExtendWith | ||
import org.mockito.InjectMocks | ||
import org.mockito.Mock | ||
import org.mockito.Mockito.times | ||
import org.mockito.Mockito.verify | ||
import org.mockito.junit.jupiter.MockitoExtension | ||
|
||
/** | ||
* Created by kevin on 17/08/15 for Podcast Server | ||
*/ | ||
@ExtendWith(MockitoExtension::class) | ||
class HibernateSearchIndexationTest { | ||
|
||
@Mock lateinit var itemBusiness: ItemBusiness | ||
@InjectMocks lateinit var hibernateSearchIndexation: HibernateSearchIndexation | ||
|
||
@Test | ||
fun should_refresh_index() { | ||
/* When */ | ||
hibernateSearchIndexation.refreshIndex() | ||
/* Then */ | ||
verify(itemBusiness, times(1)).reindex() | ||
} | ||
} |