ConsumerTypeExporter { void export(ObjectMapper mapper, Writer writer, ConsumerType consumerType) throws IOException { mapper.writeValue(writer, this.translator.translate(consumerType, ConsumerTypeDTO.class)); } @Inject  ConsumerTypeExporter(ModelTranslator translator);   }
@Test public void testConsumerTypeExport() throws IOException { ObjectMapper mapper = TestSyncUtils.getTestSyncUtils(new MapConfiguration( new HashMap<String, String>() { { put(ConfigProperties.FAIL_ON_UNKNOWN_IMPORT_PROPERTIES, "false"); } } )); translator = new StandardTranslator(mockConsumerTypeCurator, mockEnvironmentCurator, ownerCurator); ConsumerTypeExporter consumerType = new ConsumerTypeExporter(translator); StringWriter writer = new StringWriter(); ConsumerType type = new ConsumerType("TESTTYPE"); consumerType.export(mapper, writer, type); StringBuffer json = new StringBuffer(); json.append("{\"id\":null,\"label\":\"TESTTYPE\","); json.append("\"manifest\":false}"); assertTrue(TestUtil.isJsonEqual(json.toString(), writer.toString())); }