diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-18 13:18:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-18 13:18:28 -0800 |
commit | 0e209e80f03e72095e5b449679925066b01403d2 (patch) | |
tree | 881ab37ce5867fd8358d4bdf0195824c47e26be2 /test/org/traccar/BaseTest.java | |
parent | 774d560ecb5f8da9e64059a4d25622c4fba55bf2 (diff) | |
parent | c82be0541481955a0832948574244f31757f7067 (diff) | |
download | trackermap-server-0e209e80f03e72095e5b449679925066b01403d2.tar.gz trackermap-server-0e209e80f03e72095e5b449679925066b01403d2.tar.bz2 trackermap-server-0e209e80f03e72095e5b449679925066b01403d2.zip |
Merge pull request #4221 from flocsy/8bit-voice-message
Fixed 8bit voice message
Diffstat (limited to 'test/org/traccar/BaseTest.java')
-rw-r--r-- | test/org/traccar/BaseTest.java | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/test/org/traccar/BaseTest.java b/test/org/traccar/BaseTest.java index fb1b5de8f..0b2c616ce 100644 --- a/test/org/traccar/BaseTest.java +++ b/test/org/traccar/BaseTest.java @@ -1,9 +1,34 @@ package org.traccar; +import io.netty.buffer.ByteBuf; +import org.traccar.database.MediaManager; + +import java.util.HashMap; +import java.util.Map; + public class BaseTest { - + + public static class MockMediaManager extends MediaManager { + Map<String, ByteBuf> files = new HashMap<>(); + + MockMediaManager() { + super(""); + } + + @Override + public String writeFile(String uniqueId, ByteBuf buf, String extension) { + String fileName = uniqueId + "/mock." + extension; + files.put(fileName, buf); + return fileName; + } + + public ByteBuf readFile(String fileName) { + return files.get(fileName); + } + } + static { - Context.init(new TestIdentityManager()); + Context.init(new TestIdentityManager(), new MockMediaManager()); } } |