Skip to content

Commit

Permalink
[#1026] Fix junit tests in streampipes-pipeline-management
Browse files Browse the repository at this point in the history
  • Loading branch information
tenthe committed Jan 3, 2023
1 parent 57a0039 commit 86f87af
Show file tree
Hide file tree
Showing 21 changed files with 56 additions and 476 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@

package org.apache.streampipes.extensions.management.connect.adapter.format.json.arraykey;

import org.apache.streampipes.extensions.management.connect.adapter.TestUtils;

import com.google.gson.JsonObject;
import org.apache.commons.io.IOUtils;
import org.apache.streampipes.extensions.management.connect.adapter.TestUtils;
import org.junit.Test;

import java.io.InputStream;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,28 @@

public class TestImagePathReplacer {

private String testContent = "## Numerical Filter\n"
+ "\n"
+ "<img src=\"logo.png\"/>\n"
+ "\n"
+ "## Description\n"
+ "\n"
+ "Lorem ipsu";
private static final String testContentReplaced = """
## Numerical Filter
private String testContentReplaced = "## Numerical Filter\n"
+ "\n"
+ "<img src=\"/streampipes-backend/api/v2/pe/app/assets/logo.png\"/>\n"
+ "\n"
+ "## Description\n"
+ "\n"
+ "Lorem ipsu";
<img src="/streampipes-backend/api/v2/pe/app/assets/logo.png"/>
private String appId = "app";
## Description
Lorem ipsu""";

private static final String appId = "app";


@Test
public void testRegexReplacement() {
String testContent = """
## Numerical Filter
<img src="logo.png"/>
## Description
Lorem ipsu""";
String newContent = new ImagePathReplacer(testContent, appId).replaceContent();
assertEquals(testContentReplaced, newContent);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ListPropertyMatchTest {


@Test
public void matchSameDomainProperty() throws Exception {
public void matchSameDomainProperty() {
List<URI> domainProperties = new ArrayList<>();
domainProperties.add(URI.create("http://test.org/property"));

Expand All @@ -50,7 +50,7 @@ public void matchSameDomainProperty() throws Exception {
}

@Test
public void matchListWithNoFurtherRequirements() throws Exception {
public void matchListWithNoFurtherRequirements() {

EventPropertyList offer = new EventPropertyList();
EventPropertyList requirement = new EventPropertyList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
import org.apache.streampipes.vocabulary.SO;
import org.apache.streampipes.vocabulary.XSD;

import junit.framework.TestCase;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class TestDatatypeMatch extends TestCase {
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class TestDatatypeMatch {

@Test
public void testPositiveDatatypeMatch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
import org.apache.streampipes.model.client.matching.MatchingResultMessage;
import org.apache.streampipes.vocabulary.Geo;

import junit.framework.TestCase;
import org.junit.Test;

import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class TestDomainPropertyMatch extends TestCase {
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class TestDomainPropertyMatch {

@Test
public void testPositiveDomainPropertyMatch() {
Expand All @@ -56,6 +57,6 @@ public void testNegativeDomainPropertyMatch() {
}

private List<URI> buildDomainProperties(String name) {
return Arrays.asList(URI.create(name));
return List.of(URI.create(name));
}
}

This file was deleted.

0 comments on commit 86f87af

Please sign in to comment.