Commit 2e65d7da authored by Stephen Nimmo's avatar Stephen Nimmo
Browse files

Added stub definition of DeploymentAdminService

parent 69587dbd
Pipeline #73379 passed with stage
in 2 minutes and 34 seconds
......@@ -17,7 +17,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<!-- Dependency Versions -->
......
package org.opengroup.osdu.streaming.service;
import org.apache.kafka.clients.admin.TopicDescription;
import org.opengroup.osdu.streaming.model.StreamRecord;
import java.util.Optional;
public interface DeploymentAdminService {
StreamRecord createStream(StreamRecord streamRecord);
StreamRecord getStreamInfo(String id);
void startStream(StreamRecord streamRecord);
void stopStream(StreamRecord streamRecord);
void deleteStream(StreamRecord streamRecord);
}
package org.opengroup.osdu.streaming.service;
import org.opengroup.osdu.streaming.model.StreamRecord;
import org.springframework.stereotype.Service;
import org.springframework.web.context.annotation.RequestScope;
@Service
@RequestScope
public class DeploymentAdminServiceImpl implements DeploymentAdminService {
@Override
public StreamRecord createStream(StreamRecord streamRecord) {
return null;
}
@Override
public StreamRecord getStreamInfo(String id) {
return null;
}
@Override
public void startStream(StreamRecord streamRecord) {
}
@Override
public void stopStream(StreamRecord streamRecord) {
}
@Override
public void deleteStream(StreamRecord streamRecord) {
}
}
package org.opengroup.osdu.streaming.service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opengroup.osdu.streaming.model.StreamRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@DirtiesContext
public class DeploymentAdminServiceTest {
@Autowired
private DeploymentAdminService deploymentAdminService;
@Test
public void createStream() {
StreamRecord streamRecord = new StreamRecord();
StreamRecord updatedStreamRecord = deploymentAdminService.createStream(streamRecord);
assertThat(updatedStreamRecord).isNull();
}
@Test
public void getStreamInfo() {
StreamRecord streamRecord = deploymentAdminService.getStreamInfo("test");
assertThat(streamRecord).isNull();
}
@Test
public void startStream() {
StreamRecord streamRecord = new StreamRecord();
deploymentAdminService.startStream(streamRecord);
}
@Test
public void stopStream() {
StreamRecord streamRecord = new StreamRecord();
deploymentAdminService.stopStream(streamRecord);
}
@Test
public void deleteStream() {
StreamRecord streamRecord = new StreamRecord();
deploymentAdminService.deleteStream(streamRecord);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment