@Test
public void encodeRequest() throws Exception {
TestingConfiguration conf = new TestingConfiguration("bar", "example.com.", 12345);
Protocol protocol = new JSONBackendProtocol();
Record rec = Record.newRecord(new Name("foo.example.com."), Type.A, DClass.IN);
byte[] data = protocol.encode(rec, conf);
String expectedStr = "{ \"type\": \"Request\", \"moniker\": \"bar\", \"name\": \"foo\" }";
Map<String, Object> expected = mapper.readValue(expectedStr, new TypeReference<HashMap<String, Object>>(){});
Map<String, Object> actual = mapper.readValue(data, new TypeReference<HashMap<String, Object>>(){});