@Test public void convert() { BigDecimal amount = new BigDecimal(1000.01); String amountText = "tysiąc złotych i jeden grosz"; MoneyAmountTagValue moneyAmountTagValue = new MoneyAmountTagValue(); moneyAmountTagValue.setAmount(amount); moneyAmountTagValue.setText(amountText); MoneyAmount moneyAmount = moneyAmountTagValueConverter.convert(moneyAmountTagValue); assertNotNull(moneyAmount); assertEquals(amount, moneyAmount.getAmount()); assertEquals(amountText, moneyAmount.getText()); assertTrue(moneyAmount.isGenerated()); }
@Override public MoneyAmount convert(MoneyAmountTagValue tagValue) { Preconditions.checkNotNull(tagValue); MoneyAmount moneyAmount = new MoneyAmount(); moneyAmount.setAmount(tagValue.getAmount()); moneyAmount.setText(tagValue.getText()); moneyAmount.markGenerated(); return moneyAmount; }
MoneyAmountTagValueConverter implements EnrichmentTagValueConverter<MoneyAmountTagValue, MoneyAmount> { @Override public MoneyAmount convert(MoneyAmountTagValue tagValue) { Preconditions.checkNotNull(tagValue); MoneyAmount moneyAmount = new MoneyAmount(); moneyAmount.setAmount(tagValue.getAmount()); moneyAmount.setText(tagValue.getText()); moneyAmount.markGenerated(); return moneyAmount; } }
MoneyAmountTagValueConverter implements EnrichmentTagValueConverter<MoneyAmountTagValue, MoneyAmount> { @Override public MoneyAmount convert(MoneyAmountTagValue tagValue) { Preconditions.checkNotNull(tagValue); MoneyAmount moneyAmount = new MoneyAmount(); moneyAmount.setAmount(tagValue.getAmount()); moneyAmount.setText(tagValue.getText()); moneyAmount.markGenerated(); return moneyAmount; }  }
MoneyAmountTagValueConverter implements EnrichmentTagValueConverter<MoneyAmountTagValue, MoneyAmount> { @Override public MoneyAmount convert(MoneyAmountTagValue tagValue) { Preconditions.checkNotNull(tagValue); MoneyAmount moneyAmount = new MoneyAmount(); moneyAmount.setAmount(tagValue.getAmount()); moneyAmount.setText(tagValue.getText()); moneyAmount.markGenerated(); return moneyAmount; }  @Override MoneyAmount convert(MoneyAmountTagValue tagValue); }
MoneyAmountTagValueConverter implements EnrichmentTagValueConverter<MoneyAmountTagValue, MoneyAmount> { @Override public MoneyAmount convert(MoneyAmountTagValue tagValue) { Preconditions.checkNotNull(tagValue); MoneyAmount moneyAmount = new MoneyAmount(); moneyAmount.setAmount(tagValue.getAmount()); moneyAmount.setText(tagValue.getText()); moneyAmount.markGenerated(); return moneyAmount; }  @Override MoneyAmount convert(MoneyAmountTagValue tagValue);  }