Skip to content

Commit

Permalink
Add Integration Test Stubs for all Services
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Strittmatter <[email protected]>
  • Loading branch information
Weltraumschaf committed Mar 8, 2024
1 parent ddb62e3 commit d30cab9
Show file tree
Hide file tree
Showing 14 changed files with 147 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

/**
* Tests for {@link DefaultImportScanService}
*
* TODO: Add WireMock integration test.
*/
class DefaultImportScanServiceTest {
private final Config config = new Config(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link EndpointService}
*/
final class EndpointServiceTest extends WireMockBaseTestCase {
private final EndpointService sut = new EndpointService(conf());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link EngagementService}
*/
final class EngagementServiceTest extends WireMockBaseTestCase {
private final EngagementService sut = new EngagementService(conf());
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


// This test is sufficient for all services (except user profile) as all the code is generic
// TODO: Add WireMock integration test.
class FindingServiceTest {
private static final String FINDING_RESPONSE = """
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link GroupMemberService}
*/
final class GroupMemberServiceTest extends WireMockBaseTestCase {
private final GroupMemberService sut = new GroupMemberService(conf());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link GroupService}
*/
final class GroupServiceTest extends WireMockBaseTestCase {
private final GroupService sut = new GroupService(conf());
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

/**
* Tests for {@link ImportScanService}.
*
* TODO: Add WireMock integration test.
*/
class ImportScanServiceTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link ProductGroupService}
*/
final class ProductGroupServiceTest extends WireMockBaseTestCase{
private final ProductGroupService sut = new ProductGroupService(conf());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link ProductService}
*/
final class ProductServiceTest extends WireMockBaseTestCase{
private final ProductService sut = new ProductService(conf());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link TestService}
*/
final class TestServiceTest extends WireMockBaseTestCase {
private final TestService sut = new TestService(conf());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link TestTypeService}
*/
final class TestTypeServiceTest extends WireMockBaseTestCase{
private final TestTypeService sut = new TestTypeService(conf());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link ToolConfigService}
*/
final class ToolConfigServiceTest extends WireMockBaseTestCase {
private final ToolConfigService sut = new ToolConfigService(conf());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.securecodebox.persistence.defectdojo.service;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

/**
* Tests for {@link ToolTypeService}
*/
final class ToolTypeServiceTest extends WireMockBaseTestCase {
private final ToolTypeService sut = new ToolTypeService(conf());
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* This test is special because the defectdojo api does not return a list, but the generic code assumes every endpoint
* returns a list.
* </p>
*
* TODO: Add WireMock integration test.
*/
class UserProfileServiceTest {
/**
Expand Down

0 comments on commit d30cab9

Please sign in to comment.