|
1 | 1 | package org.metafacture.io; |
2 | 2 |
|
3 | | -import org.junit.*; |
4 | | -import org.metafacture.framework.MetafactureException; |
5 | | -import org.metafacture.framework.ObjectReceiver; |
6 | | - |
7 | | -import com.github.tomakehurst.wiremock.client.MappingBuilder; |
8 | | -import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder; |
9 | | -import com.github.tomakehurst.wiremock.client.WireMock; |
10 | 3 | import com.github.tomakehurst.wiremock.core.WireMockConfiguration; |
11 | | -import com.github.tomakehurst.wiremock.http.RequestMethod; |
12 | 4 | import com.github.tomakehurst.wiremock.junit.WireMockRule; |
13 | | -import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder; |
14 | | -import com.github.tomakehurst.wiremock.matching.StringValuePattern; |
15 | | -import com.github.tomakehurst.wiremock.matching.UrlPattern; |
| 5 | +import org.junit.Before; |
| 6 | +import org.junit.Rule; |
| 7 | +import org.junit.Test; |
| 8 | +import org.metafacture.framework.MetafactureException; |
| 9 | +import org.metafacture.framework.ObjectReceiver; |
16 | 10 | import org.metafacture.framework.helpers.DefaultObjectPipe; |
17 | | -import org.metafacture.framework.helpers.DefaultObjectReceiver; |
18 | 11 | import org.mockito.Mock; |
19 | 12 | import org.mockito.junit.MockitoJUnit; |
20 | 13 | import org.mockito.junit.MockitoRule; |
21 | 14 |
|
22 | | - |
23 | 15 | import java.io.BufferedReader; |
24 | 16 | import java.io.IOException; |
25 | 17 | import java.io.Reader; |
26 | | -import java.util.Arrays; |
27 | | -import java.util.function.BiConsumer; |
28 | | -import java.util.function.Consumer; |
29 | 18 |
|
30 | 19 |
|
31 | 20 | public final class SruOpenerTest { |
@@ -60,13 +49,11 @@ public void setUp() { |
60 | 49 | public void process(final Reader reader) { |
61 | 50 | int size; |
62 | 51 | try { |
63 | | - while ((size = reader.read(buffer)) != -1) { |
64 | | - int offset = 0; |
65 | | - for (int i = 0; i < size; ++i) { |
66 | | - resultCollector.append(buffer, offset, size - offset); |
67 | | - offset = i + 1; |
| 52 | + BufferedReader bufferedReader = new BufferedReader(reader); |
| 53 | + String line; |
| 54 | + while ((line = bufferedReader.readLine()) != null) { |
| 55 | + resultCollector.append(line+"\n"); |
68 | 56 | } |
69 | | - } |
70 | 57 | } |
71 | 58 | catch (final IOException e) { |
72 | 59 | throw new MetafactureException(e); |
|
0 commit comments