@Test
public void testImportTypeMap() {

    CodeGeneratorRequest request = TestRequestLoader.getImportRequest();
    TypeRegistry map = RequestInfo.withTypeRegistry(request).getTypeRegistry();
    assertEquals(8, map.typeMap.entrySet().size());
    assertEquals("protos.test.protobuf.ContainerMessage", map.resolveMessageType(".quickbuf_unittest.ContainerMessage").toString());
    assertEquals("protos.test.protobuf.ForeignEnum", map.resolveMessageType(".quickbuf_unittest.ForeignEnum").toString());
    // Make sure lookup directly by typename
    String typeId = request
            .getProtoFile(1) // namespaces_import.proto
            .getMessageType(0) // ContainerMessage
            .getField(6) // optional_nested_import_message
            .getTypeName();
    assertEquals("protos.test.protobuf.external.ImportMessage.NestedImportMessage", map.resolveMessageType(typeId).toString());
}