Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit 44db641

Browse files
committed
Get back tests from jooby-core
1 parent 42d1470 commit 44db641

10 files changed

Lines changed: 6 additions & 65 deletions

File tree

TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
* review media type and body converter selector

jooby-core/src/main/java/jooby/MediaType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ private MediaType doFirst(final List<MediaType> candidates) {
220220
/** Form url encoded. */
221221
public static MediaType form = new MediaType("application", "x-www-form-urlencoded");
222222

223+
public static MediaType xml = new MediaType("application", "xml");
224+
223225
/**
224226
* Track the type of this media type.
225227
*/

jooby-core/src/main/java/jooby/internal/AssetBodyConverter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public <T> T read(final TypeLiteral<T> type, final BodyReader reader) throws Exc
5151
public void write(final Body body, final BodyWriter writer) throws Exception {
5252
Asset asset = (Asset) body.content().get();
5353
boolean text = mediaType.equals(MediaType.javascript) || mediaType.equals(MediaType.css)
54-
|| mediaType.equals(MediaType.json) || MediaType.text.matches(mediaType);
54+
|| mediaType.equals(MediaType.json) || MediaType.text.matches(mediaType)
55+
|| mediaType.equals(MediaType.xml);
56+
5557
if (text) {
5658
writer.text(to -> {
5759
try (Reader from = new InputStreamReader(asset.stream(), writer.charset())) {

jooby-core/src/main/java/jooby/internal/GetHeader.java

Lines changed: 0 additions & 62 deletions
This file was deleted.
File renamed without changes.

jooby-core/java/jooby/FileMediaTypeProviderTest.java renamed to jooby-core/src/test/java/jooby/MediaTypeProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import com.typesafe.config.Config;
1111
import com.typesafe.config.ConfigFactory;
1212

13-
public class FileMediaTypeProviderTest {
13+
public class MediaTypeProviderTest {
1414

1515
private static Config config;
1616

File renamed without changes.
File renamed without changes.
File renamed without changes.

jooby-core/java/jooby/internal/RoutePathTest.java renamed to jooby-core/src/test/java/jooby/internal/RoutePathTest.java

File renamed without changes.

0 commit comments

Comments
 (0)