-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marvin Hofer
committed
Jun 6, 2023
1 parent
ab019d3
commit 99a086d
Showing
17 changed files
with
182 additions
and
217 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
7 changes: 2 additions & 5 deletions
7
...core/src/main/scala/org/dbpedia/databus/mods/core/worker/api/ModActivityApiHttpPoll.scala
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
2 changes: 1 addition & 1 deletion
2
...bus-mods-dummy/src/main/scala/org/dbpedia/databus/mods/worker/dummy/FakeDatabusImpl.scala
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
123 changes: 60 additions & 63 deletions
123
...b/databus-mods-dummy/src/test/scala/org/dbpedia/databus/mods/worker/dummy/DummyTest.scala
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 |
---|---|---|
@@ -1,63 +1,60 @@ | ||
package org.dbpedia.databus.mods.worker.dummy | ||
|
||
import org.apache.commons.io.IOUtils | ||
import org.dbpedia.databus.mods.core.model.ModActivity | ||
import org.dbpedia.databus.mods.core.worker.api.ModActivityClientHttp | ||
import org.dbpedia.databus.mods.worker.springboot.controller.{ActivityController, ActivityControllerPollImpl} | ||
import org.dbpedia.databus.mods.worker.springboot.service.ActivityExecutionService | ||
import org.junit.jupiter.api.Test | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.boot.test.context.SpringBootTest | ||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment | ||
import org.springframework.boot.test.web.client.TestRestTemplate | ||
import org.springframework.boot.web.server.LocalServerPort | ||
import org.springframework.http.{HttpEntity, HttpHeaders, HttpMethod, MediaType, ResponseEntity} | ||
import org.springframework.util.LinkedMultiValueMap | ||
|
||
import java.net.URI | ||
|
||
|
||
@SpringBootTest( | ||
webEnvironment = WebEnvironment.RANDOM_PORT, | ||
classes = Array(classOf[DummyWorker]) | ||
) | ||
class DummyTest { | ||
|
||
@LocalServerPort | ||
private var port: Integer = _ | ||
|
||
@Autowired | ||
private var activityService: ActivityExecutionService = _ | ||
|
||
@Autowired | ||
private var workerApi: ActivityController = _ | ||
|
||
@Autowired | ||
private var databusImpl: FakeDatabusImpl = _ | ||
|
||
@Autowired | ||
private var modActivity: ModActivity = _ | ||
|
||
@Test | ||
def contextLoad(): Unit = { | ||
assert(activityService != null) | ||
assert(workerApi != null) | ||
assert(workerApi.isInstanceOf[ActivityControllerPollImpl]) | ||
assert(modActivity != null); | ||
assert(databusImpl != null) | ||
} | ||
|
||
@Test | ||
def test(): Unit = { | ||
|
||
val client = new ModActivityClientHttp | ||
|
||
val result = client.send( | ||
new URI(s"http://localhost:${port}/activity"), | ||
new URI(s"http://localhost:${port}/publisher/group/artifact/version/file"), | ||
minDelay = 1000 | ||
) | ||
|
||
IOUtils.write(result.data,System.out) | ||
} | ||
} | ||
//package org.dbpedia.databus.mods.worker.dummy | ||
// | ||
//import org.apache.commons.io.IOUtils | ||
//import org.dbpedia.databus.mods.core.model.ModActivity | ||
//import org.dbpedia.databus.mods.core.worker.api.ModActivityClientHttp | ||
//import org.dbpedia.databus.mods.worker.springboot.controller.{ActivityController, ActivityControllerPollImpl} | ||
//import org.dbpedia.databus.mods.worker.springboot.service.ActivityExecutionService | ||
//import org.junit.jupiter.api.Test | ||
//import org.springframework.beans.factory.annotation.Autowired | ||
//import org.springframework.boot.test.context.SpringBootTest | ||
//import org.springframework.boot.test.context.SpringBootTest.WebEnvironment | ||
//import org.springframework.boot.test.web.server.LocalServerPort | ||
// | ||
//import java.net.URI | ||
// | ||
// | ||
//@SpringBootTest( | ||
// webEnvironment = WebEnvironment.RANDOM_PORT, | ||
// classes = Array(classOf[DummyWorker]) | ||
//) | ||
//class DummyTest { | ||
// | ||
// @LocalServerPort | ||
// private var port: Integer = _ | ||
// | ||
//// @Autowired | ||
//// private var activityService: ActivityExecutionService = _ | ||
// | ||
// @Autowired | ||
// private var workerApi: ActivityController = _ | ||
// | ||
// @Autowired | ||
// private var databusImpl: FakeDatabusImpl = _ | ||
// | ||
// @Autowired | ||
// private var modActivity: ModActivity = _ | ||
// | ||
// @Test | ||
// def contextLoad(): Unit = { | ||
//// assert(activityService != null) | ||
// assert(workerApi != null) | ||
// assert(workerApi.isInstanceOf[ActivityControllerPollImpl]) | ||
// assert(modActivity != null); | ||
// assert(databusImpl != null) | ||
// } | ||
// | ||
// @Test | ||
// def test(): Unit = { | ||
// | ||
// val client = new ModActivityClientHttp | ||
// | ||
// val result = client.send( | ||
// new URI(s"http://localhost:${port}/activity"), | ||
// new URI(s"http://localhost:${port}/publisher/group/artifact/version/file"), | ||
// minDelay = 1000 | ||
// ) | ||
// | ||
// IOUtils.write(result.data,System.out) | ||
// } | ||
//} |
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
4 changes: 1 addition & 3 deletions
4
.../scala/org/dbpedia/databus/mods/worker/springboot/controller/ActivityControllerImpl.scala
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
11 changes: 1 addition & 10 deletions
11
...la/org/dbpedia/databus/mods/worker/springboot/controller/ActivityControllerPollImpl.scala
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
3 changes: 1 addition & 2 deletions
3
...ala/org/dbpedia/databus/mods/worker/springboot/controller/BasicResultFileController.scala
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
Oops, something went wrong.