Skip to content

Commit db00647

Browse files
committed
use uppercase T in all mimeType naming
1 parent 035fa68 commit db00647

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed

dsf-bpe/dsf-bpe-process-api-v2-impl/src/main/java/dev/dsf/bpe/v2/ProcessPluginApiImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class ProcessPluginApiImpl implements ProcessPluginApi, InitializingBean
3030
private final OidcClientProvider oidcClientProvider;
3131
private final MailService mailService;
3232

33-
private final MimeTypeService mimetypeService;
33+
private final MimeTypeService mimeTypeService;
3434
private final ObjectMapper objectMapper;
3535
private final OrganizationProvider organizationProvider;
3636
private final ProcessAuthorizationHelper processAuthorizationHelper;
@@ -40,7 +40,7 @@ public class ProcessPluginApiImpl implements ProcessPluginApi, InitializingBean
4040

4141
public ProcessPluginApiImpl(ProxyConfig proxyConfig, EndpointProvider endpointProvider, FhirContext fhirContext,
4242
DsfClientProvider dsfClientProvider, FhirClientProvider fhirClientProvider,
43-
OidcClientProvider oidcClientProvider, MailService mailService, MimeTypeService mimetypeService,
43+
OidcClientProvider oidcClientProvider, MailService mailService, MimeTypeService mimeTypeService,
4444
ObjectMapper objectMapper, OrganizationProvider organizationProvider,
4545
ProcessAuthorizationHelper processAuthorizationHelper,
4646
QuestionnaireResponseHelper questionnaireResponseHelper, ReadAccessHelper readAccessHelper,
@@ -53,7 +53,7 @@ public ProcessPluginApiImpl(ProxyConfig proxyConfig, EndpointProvider endpointPr
5353
this.fhirClientProvider = fhirClientProvider;
5454
this.oidcClientProvider = oidcClientProvider;
5555
this.mailService = mailService;
56-
this.mimetypeService = mimetypeService;
56+
this.mimeTypeService = mimeTypeService;
5757
this.objectMapper = objectMapper;
5858
this.organizationProvider = organizationProvider;
5959
this.processAuthorizationHelper = processAuthorizationHelper;
@@ -123,9 +123,9 @@ public MailService getMailService()
123123
}
124124

125125
@Override
126-
public MimeTypeService getMimetypeService()
126+
public MimeTypeService getMimeTypeService()
127127
{
128-
return mimetypeService;
128+
return mimeTypeService;
129129
}
130130

131131
@Override

dsf-bpe/dsf-bpe-process-api-v2-impl/src/main/java/dev/dsf/bpe/v2/service/MimeTypeServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public ValidationResult validateWithResult(InputStream stream, String declared)
4646
}
4747
catch (IOException exception)
4848
{
49-
throw new RuntimeException("Error while detecting mimetype", exception);
49+
throw new RuntimeException("Error while detecting MIME type", exception);
5050
}
5151
}
5252
}

dsf-bpe/dsf-bpe-process-api-v2-impl/src/main/java/dev/dsf/bpe/v2/spring/ApiServiceConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class ApiServiceConfig
9393
public ProcessPluginApi processPluginApiV2()
9494
{
9595
return new ProcessPluginApiImpl(proxyConfigDelegate(), endpointProvider(), fhirContext(), dsfClientProvider(),
96-
fhirClientProvider(), oidcClientProvider(), mailService(), mimetypeService(), objectMapper(),
96+
fhirClientProvider(), oidcClientProvider(), mailService(), mimeTypeService(), objectMapper(),
9797
organizationProvider(), processAuthorizationHelper(), questionnaireResponseHelper(), readAccessHelper(),
9898
taskHelper());
9999
}
@@ -154,7 +154,7 @@ public MailService mailService()
154154
}
155155

156156
@Bean
157-
public MimeTypeService mimetypeService()
157+
public MimeTypeService mimeTypeService()
158158
{
159159
Detector detector = CombinedDetectors.withDefaultAndNdJson(NdJsonDetector.DEFAULT_LINES_TO_CHECK);
160160
return new MimeTypeServiceImpl(detector);

dsf-bpe/dsf-bpe-process-api-v2/src/main/java/dev/dsf/bpe/v2/ProcessPluginApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public interface ProcessPluginApi
4242

4343
MailService getMailService();
4444

45-
MimeTypeService getMimetypeService();
45+
MimeTypeService getMimeTypeService();
4646

4747
ObjectMapper getObjectMapper();
4848

dsf-bpe/dsf-bpe-process-api-v2/src/main/java/dev/dsf/bpe/v2/service/MimeTypeService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public String detected()
2323
return detectedBaseType + "/" + detectedSubType;
2424
}
2525

26-
public boolean mimetypesMatch()
26+
public boolean mimeTypesMatch()
2727
{
2828
return declared().equals(detected());
2929
}
@@ -70,7 +70,7 @@ default ValidationResult validateWithResult(byte[] data, String declared)
7070
*/
7171
default boolean validateWithBoolean(InputStream stream, String declared)
7272
{
73-
return validateWithResult(stream, declared).mimetypesMatch();
73+
return validateWithResult(stream, declared).mimeTypesMatch();
7474
}
7575

7676
/**
@@ -85,7 +85,7 @@ default boolean validateWithBoolean(InputStream stream, String declared)
8585
*/
8686
default boolean validateWithBoolean(byte[] data, String declared)
8787
{
88-
return validateWithResult(new ByteArrayInputStream(data), declared).mimetypesMatch();
88+
return validateWithResult(new ByteArrayInputStream(data), declared).mimeTypesMatch();
8989
}
9090

9191
/**
@@ -104,7 +104,7 @@ default void validateWithException(InputStream stream, String declared)
104104
{
105105
ValidationResult result = validateWithResult(stream, declared);
106106

107-
if (!result.mimetypesMatch())
107+
if (!result.mimeTypesMatch())
108108
logger.warn("Declared full MIME type {} does not match detected full MIME type {}", result.declared(),
109109
result.detected());
110110

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void apiGetMailServiceNotNull(ProcessPluginApi api) throws Exception
6262
@PluginTest
6363
public void apiGetMimetypeService(ProcessPluginApi api) throws Exception
6464
{
65-
expectNotNull(api.getMimetypeService());
65+
expectNotNull(api.getMimeTypeService());
6666
}
6767

6868
@PluginTest

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,47 +25,47 @@ public class MimeTypeServiceTest extends AbstractTest implements ServiceTask
2525
@Override
2626
public void execute(ProcessPluginApi api, Variables variables) throws ErrorBoundaryEvent, Exception
2727
{
28-
executeTests(api, variables, api.getMimetypeService());
28+
executeTests(api, variables, api.getMimeTypeService());
2929
}
3030

3131
@PluginTest
32-
public void testAttachmentBundle(MimeTypeService mimetypeService)
32+
public void testAttachmentBundle(MimeTypeService mimeTypeService)
3333
{
3434
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
3535
"fhir/Bundle/DocumentReference-with-Attachment-Bundle.xml");
36-
testResourcesStream(resources, mimetypeService);
36+
testResourcesStream(resources, mimeTypeService);
3737
}
3838

3939
@PluginTest
40-
public void testAttachmentCsv(MimeTypeService mimetypeService)
40+
public void testAttachmentCsv(MimeTypeService mimeTypeService)
4141
{
4242
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
4343
"fhir/Bundle/DocumentReference-with-Attachment-CSV.xml");
44-
testResourcesStream(resources, mimetypeService);
44+
testResourcesStream(resources, mimeTypeService);
4545
}
4646

4747
@PluginTest
48-
public void testAttachmentMeasureReport(MimeTypeService mimetypeService)
48+
public void testAttachmentMeasureReport(MimeTypeService mimeTypeService)
4949
{
5050
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
5151
"fhir/Bundle/DocumentReference-with-Attachment-MeasureReport.xml");
52-
testResourcesStream(resources, mimetypeService);
52+
testResourcesStream(resources, mimeTypeService);
5353
}
5454

5555
@PluginTest
56-
public void testAttachmentNdJson(MimeTypeService mimetypeService)
56+
public void testAttachmentNdJson(MimeTypeService mimeTypeService)
5757
{
5858
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
5959
"fhir/Bundle/DocumentReference-with-Attachment-NdJson.xml");
60-
testResourcesStream(resources, mimetypeService);
60+
testResourcesStream(resources, mimeTypeService);
6161
}
6262

6363
@PluginTest
64-
public void testAttachmentZip(MimeTypeService mimetypeService)
64+
public void testAttachmentZip(MimeTypeService mimeTypeService)
6565
{
6666
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
6767
"fhir/Bundle/DocumentReference-with-Attachment-ZIP.xml");
68-
testResourcesStream(resources, mimetypeService);
68+
testResourcesStream(resources, mimeTypeService);
6969
}
7070

7171
private List<Resource> getResourcesNotDocumentReferenceFromPath(String pathToBundle)
@@ -83,31 +83,31 @@ private List<Resource> getResourcesNotDocumentReferenceFromPath(String pathToBun
8383
}
8484
}
8585

86-
private void testResourcesStream(List<Resource> resources, MimeTypeService mimetypeService)
86+
private void testResourcesStream(List<Resource> resources, MimeTypeService mimeTypeService)
8787
{
8888
for (Resource resource : resources)
8989
{
9090
InputStream data = getDataStream(resource);
9191
String mimeType = getMimetype(resource);
9292

93-
MimeTypeService.ValidationResult validationResult = mimetypeService.validateWithResult(data, mimeType);
94-
if (!validationResult.mimetypesMatch())
93+
MimeTypeService.ValidationResult validationResult = mimeTypeService.validateWithResult(data, mimeType);
94+
if (!validationResult.mimeTypesMatch())
9595
throw new RuntimeException(
96-
"Detected mimetype does not match expected mimetype (#validateWithResult())");
96+
"Detected MIME type does not match expected MIME type (#validateWithResult())");
9797

98-
boolean mimetypesMatch = mimetypeService.validateWithBoolean(data, mimeType);
99-
if (!mimetypesMatch)
98+
boolean mimeTypesMatch = mimeTypeService.validateWithBoolean(data, mimeType);
99+
if (!mimeTypesMatch)
100100
throw new RuntimeException(
101-
"Detected mimetype does not match expected mimetype (#validateWithBoolean())");
101+
"Detected MIME type does not match expected MIME type (#validateWithBoolean())");
102102

103103
try
104104
{
105-
mimetypeService.validateWithException(data, mimeType);
105+
mimeTypeService.validateWithException(data, mimeType);
106106
}
107107
catch (Exception e)
108108
{
109109
throw new RuntimeException(
110-
"Detected mimetype does not match expected mimetype (#validateWithException()) - "
110+
"Detected MIME type does not match expected MIME type (#validateWithException()) - "
111111
+ e.getMessage());
112112
}
113113
}

dsf-bpe/dsf-bpe-test-plugin-v2/src/main/resources/bpe/test.bpmn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@
237237
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${testActivity == 'JsonVariableTest'}</bpmn:conditionExpression>
238238
</bpmn:sequenceFlow>
239239
<bpmn:sequenceFlow id="Flow_0x6aoim" sourceRef="JsonVariableTestGet" targetRef="Gateway_056f6tw" />
240-
<bpmn:serviceTask id="MimetypeServiceTest" name="MimetypeServiceTest" camunda:class="dev.dsf.bpe.test.service.MimeTypeServiceTest">
240+
<bpmn:serviceTask id="MimeTypeServiceTest" name="MimeTypeServiceTest" camunda:class="dev.dsf.bpe.test.service.MimeTypeServiceTest">
241241
<bpmn:incoming>Flow_1gkrz8f</bpmn:incoming>
242242
<bpmn:outgoing>Flow_1le3eld</bpmn:outgoing>
243243
</bpmn:serviceTask>
244-
<bpmn:sequenceFlow id="Flow_1le3eld" sourceRef="MimetypeServiceTest" targetRef="Gateway_056f6tw" />
245-
<bpmn:sequenceFlow id="Flow_1gkrz8f" sourceRef="Gateway_0eszi2t" targetRef="MimetypeServiceTest">
244+
<bpmn:sequenceFlow id="Flow_1le3eld" sourceRef="MimeTypeServiceTest" targetRef="Gateway_056f6tw" />
245+
<bpmn:sequenceFlow id="Flow_1gkrz8f" sourceRef="Gateway_0eszi2t" targetRef="MimeTypeServiceTest">
246246
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${testActivity == 'MimetypeServiceTest'}</bpmn:conditionExpression>
247247
</bpmn:sequenceFlow>
248248
</bpmn:process>
@@ -345,7 +345,7 @@
345345
<dc:Bounds x="650" y="1300" width="100" height="80" />
346346
<bpmndi:BPMNLabel />
347347
</bpmndi:BPMNShape>
348-
<bpmndi:BPMNShape id="Activity_1uknvol_di" bpmnElement="MimetypeServiceTest">
348+
<bpmndi:BPMNShape id="Activity_1uknvol_di" bpmnElement="MimeTypeServiceTest">
349349
<dc:Bounds x="480" y="1430" width="100" height="80" />
350350
<bpmndi:BPMNLabel />
351351
</bpmndi:BPMNShape>

0 commit comments

Comments
 (0)