Skip to content

Commit 2cf63e9

Browse files
committed
remove redundant test
1 parent f56f325 commit 2cf63e9

File tree

2 files changed

+21
-141
lines changed

2 files changed

+21
-141
lines changed

dsf-bpe/dsf-bpe-process-api-v2-impl/src/test/java/dev/dsf/bpe/v2/service/MimetypeServiceTest.java

Lines changed: 0 additions & 139 deletions
This file was deleted.

dsf-bpe/dsf-bpe-test-plugin-v2/src/main/java/dev/dsf/bpe/test/service/MimetypeServiceTest.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,28 @@ private void testResourcesStream(List<Resource> resources, MimetypeService mimet
8888
for (Resource resource : resources)
8989
{
9090
InputStream data = getDataStream(resource);
91-
String expected = getMimetype(resource);
91+
String mimeType = getMimetype(resource);
9292

93-
mimetypeService.validateWithException(data, expected);
93+
MimetypeService.ValidationResult validationResult = mimetypeService.validateWithResult(data, mimeType);
94+
if (!validationResult.mimetypesMatch())
95+
throw new RuntimeException(
96+
"Detected mimetype does not match expected mimetype (#validateWithResult())");
97+
98+
boolean mimetypesMatch = mimetypeService.validateWithBoolean(data, mimeType);
99+
if (!mimetypesMatch)
100+
throw new RuntimeException(
101+
"Detected mimetype does not match expected mimetype (#validateWithBoolean())");
102+
103+
try
104+
{
105+
mimetypeService.validateWithException(data, mimeType);
106+
}
107+
catch (Exception e)
108+
{
109+
throw new RuntimeException(
110+
"Detected mimetype does not match expected mimetype (#validateWithException()) - "
111+
+ e.getMessage());
112+
}
94113
}
95114
}
96115

0 commit comments

Comments
 (0)