[
https://issues.apache.org/jira/browse/KNOX-3452?focusedWorklogId=1040868&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1040868
]
ASF GitHub Bot logged work on KNOX-3452:
----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Sep/26 08:15
Start Date: 11/Sep/26 08:15
Worklog Time Spent: 10m
Work Description: Raghav-Mah3shwari opened a new pull request, #1393:
URL: https://github.com/apache/knox/pull/1393
## What changes were proposed in this pull request?
This pull request adds comprehensive unit test coverage for
`org.apache.knox.gateway.util.MimeTypes`.
The tests cover MIME type creation, charset insertion and preservation,
malformed input handling, charset fallback behavior, MIME parameter
preservation, wildcard MIME types, normalization, and default charset lookup.
## How was this patch tested?
The following command was executed:
```bash
mvn -pl gateway-util-common -Dtest=MimeTypesTest -Denforcer.skip=true test
```
Results:
- 32 tests executed
- 0 failures
- 0 errors
- 0 skipped tests
- 0 Checkstyle violations
## Integration Tests
No integration tests were added because this change only adds unit tests for
the `MimeTypes` utility class and does not change runtime behavior.
The unit tests are located at:
```text
gateway-util-common/src/test/java/org/apache/knox/gateway/util/MimeTypesTest.java
```
## UI changes
Not applicable. This change does not affect the UI.
Issue Time Tracking
-------------------
Worklog Id: (was: 1040868)
Remaining Estimate: 0h
Time Spent: 10m
> Add comprehensive unit tests for MimeTypes
> ------------------------------------------
>
> Key: KNOX-3452
> URL: https://issues.apache.org/jira/browse/KNOX-3452
> Project: Apache Knox
> Issue Type: Task
> Reporter: Raghav Maheshwari
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Add comprehensive unit test coverage for
> org.apache.knox.gateway.util.MimeTypes.
> The tests should cover MIME type creation, charset handling, invalid input,
> charset fallback behavior, MIME parameter preservation, wildcard MIME types,
> normalization, and default charset lookup.
> Test coverage:
> •Null MIME type creation
> •Valid MIME type creation
> •Custom charset insertion
> •UTF-8 charset insertion
> •Existing charset preservation
> •Quoted charset values
> •Case-insensitive charset parameter names
> •Preservation of additional MIME parameters
> •Wildcard MIME types
> •Malformed, empty, and whitespace-only MIME types
> •Charset lookup with explicit and fallback values
> •Charset lookup with null MIME types
> •Adding and replacing charset parameters
> •Preservation of parameters when setting charset
> •Default charset lookup for supported MIME types
> •Case and whitespace normalization
> •Unknown, empty, parameterized, and structured MIME types
--
This message was sent by Atlassian Jira
(v8.20.10#820010)