Skip to content

Commit

Permalink
rename "licenseTemplatesNumbers" to "licenseTemplateNumbers"
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rudkovskiy committed May 16, 2023
1 parent a0431ad commit 3d3e789
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public static final class Bundle {
public static final String ENDPOINT_PATH = "bundle";
public static final String ENDPOINT_OBTAIN_PATH = "obtain";
public static final String DESCRIPTION = "description";
public static final String LICENSE_TEMPLATES_NUMBERS = "licenseTemplatesNumbers";
public static final String LICENSE_TEMPLATE_NUMBERS = "licenseTemplateNumbers";
}
// CHECKSTYLE:ON
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public interface Bundle extends BaseEntity {

String getDescription();

void setLicenseTemplatesNumbers(List<String> licenseTemplatesNumbers);
void setLicenseTemplateNumbers(List<String> licenseTemplateNumbers);

List<String> getLicenseTemplatesNumbers();
List<String> getLicenseTemplateNumbers();

void addLicenseTemplateNumber(String licenseTemplateNumber);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BundleImpl extends BaseEntityImpl implements Bundle {

private Currency currency;

private List<String> licenseTemplatesNumbers;
private List<String> licenseTemplateNumbers;

@Override
public void setName(final String name) {
Expand Down Expand Up @@ -62,31 +62,31 @@ public String getDescription() {
}

@Override
public void setLicenseTemplatesNumbers(final List<String> licenseTemplatesNumbers) {
this.licenseTemplatesNumbers = licenseTemplatesNumbers;
public void setLicenseTemplateNumbers(final List<String> licenseTemplateNumbers) {
this.licenseTemplateNumbers = licenseTemplateNumbers;
}

@Override
public List<String> getLicenseTemplatesNumbers() {
return licenseTemplatesNumbers;
public List<String> getLicenseTemplateNumbers() {
return licenseTemplateNumbers;
}

@Override
public void addLicenseTemplateNumber(final String licenseTemplateNumber) {
if (getLicenseTemplatesNumbers() == null) {
this.licenseTemplatesNumbers = new ArrayList<>();
if (getLicenseTemplateNumbers() == null) {
this.licenseTemplateNumbers = new ArrayList<>();
}

this.licenseTemplatesNumbers.add(licenseTemplateNumber);
this.licenseTemplateNumbers.add(licenseTemplateNumber);
}

@Override
public void removeLicenseTemplateNumber(final String licenseTemplateNumber) {
if (getLicenseTemplatesNumbers() == null) {
if (getLicenseTemplateNumbers() == null) {
return;
}

getLicenseTemplatesNumbers().remove(licenseTemplateNumber);
getLicenseTemplateNumbers().remove(licenseTemplateNumber);
}

public static List<String> getReservedProps() {
Expand All @@ -95,7 +95,7 @@ public static List<String> getReservedProps() {
reserved.add(Constants.Bundle.DESCRIPTION);
reserved.add(Constants.PRICE);
reserved.add(Constants.CURRENCY);
reserved.add(Constants.Bundle.LICENSE_TEMPLATES_NUMBERS);
reserved.add(Constants.Bundle.LICENSE_TEMPLATE_NUMBERS);
return reserved;
}

Expand All @@ -111,8 +111,8 @@ protected MultivaluedMap<String, Object> asPropertiesMap() {
map.add(Constants.PRICE, getPrice());
map.add(Constants.CURRENCY, getCurrency());

if (getLicenseTemplatesNumbers() != null) {
map.add(Constants.Bundle.LICENSE_TEMPLATES_NUMBERS, String.join(",", getLicenseTemplatesNumbers()));
if (getLicenseTemplateNumbers() != null) {
map.add(Constants.Bundle.LICENSE_TEMPLATE_NUMBERS, String.join(",", getLicenseTemplateNumbers()));
}

return map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public Bundle convert(final Item source) throws ConversionException {
target.setCurrency(Currency.valueOf(price.getCurrencyCode()));
}

final String licenseTemplatesNumbers = SchemaFunction.propertyByName(source.getProperty(), Constants.Bundle.LICENSE_TEMPLATES_NUMBERS).getValue();
final String licenseTemplateNumbers = SchemaFunction.propertyByName(source.getProperty(), Constants.Bundle.LICENSE_TEMPLATE_NUMBERS).getValue();

if (licenseTemplatesNumbers != null) {
target.setLicenseTemplatesNumbers(Arrays.asList(licenseTemplatesNumbers.split(",")));
if (licenseTemplateNumbers != null) {
target.setLicenseTemplateNumbers(Arrays.asList(licenseTemplateNumbers.split(",")));
}

// Custom properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ public void testCreate() throws Exception {
final boolean active = true;
final BigDecimal price = new BigDecimal(10);
final Currency currency = Currency.EUR;
final List<String> licenseTemplatesNumbers = new ArrayList<>();
licenseTemplatesNumbers.add("LT001-TEST");
licenseTemplatesNumbers.add("LT002-TEST");
final List<String> licenseTemplateNumbers = new ArrayList<>();
licenseTemplateNumbers.add("LT001-TEST");
licenseTemplateNumbers.add("LT002-TEST");

final Bundle bundle = new BundleImpl();
bundle.setName(name);
Expand All @@ -119,7 +119,7 @@ public void testCreate() throws Exception {
bundle.setActive(active);
bundle.setPrice(price);
bundle.setCurrency(currency);
bundle.setLicenseTemplatesNumbers(licenseTemplatesNumbers);
bundle.setLicenseTemplateNumbers(licenseTemplateNumbers);

final Bundle createdBundle = BundleService.create(context, bundle);

Expand All @@ -130,7 +130,7 @@ public void testCreate() throws Exception {
assertEquals(active, createdBundle.getActive());
assertEquals(price, createdBundle.getPrice());
assertEquals(currency, createdBundle.getCurrency());
assertEquals(licenseTemplatesNumbers, createdBundle.getLicenseTemplatesNumbers());
assertEquals(licenseTemplateNumbers, createdBundle.getLicenseTemplateNumbers());
}

@Test
Expand All @@ -141,9 +141,9 @@ public void testGet() throws Exception {
final boolean active = true;
final BigDecimal price = new BigDecimal(10);
final Currency currency = Currency.EUR;
final List<String> licenseTemplatesNumbers = new ArrayList<>();
licenseTemplatesNumbers.add("LT001-TEST");
licenseTemplatesNumbers.add("LT002-TEST");
final List<String> licenseTemplateNumbers = new ArrayList<>();
licenseTemplateNumbers.add("LT001-TEST");
licenseTemplateNumbers.add("LT002-TEST");

final Bundle bundle = BundleService.get(context, "B014-TEST");
assertNotNull(bundle);
Expand All @@ -153,15 +153,15 @@ public void testGet() throws Exception {
assertEquals(active, bundle.getActive());
assertEquals(price, bundle.getPrice());
assertEquals(currency, bundle.getCurrency());
assertEquals(licenseTemplatesNumbers, bundle.getLicenseTemplatesNumbers());
assertEquals(licenseTemplateNumbers, bundle.getLicenseTemplateNumbers());
}

@Test
public void testList() throws Exception {
final Page<Bundle> bundles = BundleService.list(context, null);
final List<String> licenseTemplatesNumbers = new ArrayList<>();
licenseTemplatesNumbers.add("LT005-TEST");
licenseTemplatesNumbers.add("LT006-TEST");
final List<String> licenseTemplateNumbers = new ArrayList<>();
licenseTemplateNumbers.add("LT005-TEST");
licenseTemplateNumbers.add("LT006-TEST");


assertNotNull(bundles);
Expand All @@ -171,7 +171,7 @@ public void testList() throws Exception {
assertEquals("Bundle 2", bundles.getContent().get(1).getName());
assertEquals(Currency.USD, bundles.getContent().get(1).getCurrency());
assertEquals(BigDecimal.valueOf(30), bundles.getContent().get(2).getPrice());
assertEquals(licenseTemplatesNumbers, bundles.getContent().get(2).getLicenseTemplatesNumbers());
assertEquals(licenseTemplateNumbers, bundles.getContent().get(2).getLicenseTemplateNumbers());
}

@Test
Expand All @@ -182,9 +182,9 @@ public void testUpdate() throws Exception {
final boolean active = false;
final BigDecimal price = new BigDecimal(20);
final Currency currency = Currency.USD;
final List<String> licenseTemplatesNumbers = new ArrayList<>();
licenseTemplatesNumbers.add("LT003-TEST");
licenseTemplatesNumbers.add("LT004-TEST");
final List<String> licenseTemplateNumbers = new ArrayList<>();
licenseTemplateNumbers.add("LT003-TEST");
licenseTemplateNumbers.add("LT004-TEST");

final Bundle bundle = new BundleImpl();
bundle.setName(name);
Expand All @@ -193,7 +193,7 @@ public void testUpdate() throws Exception {
bundle.setActive(active);
bundle.setPrice(price);
bundle.setCurrency(currency);
bundle.setLicenseTemplatesNumbers(licenseTemplatesNumbers);
bundle.setLicenseTemplateNumbers(licenseTemplateNumbers);

final Bundle updatedBundle = BundleService.create(context, bundle);

Expand All @@ -204,7 +204,7 @@ public void testUpdate() throws Exception {
assertEquals(active, updatedBundle.getActive());
assertEquals(price, updatedBundle.getPrice());
assertEquals(currency, updatedBundle.getCurrency());
assertEquals(licenseTemplatesNumbers, updatedBundle.getLicenseTemplatesNumbers());
assertEquals(licenseTemplateNumbers, updatedBundle.getLicenseTemplateNumbers());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<property name="description">Description 1</property>
<property name="price">10</property>
<property name="currency">EUR</property>
<property name="licenseTemplatesNumbers">LT001-TEST,LT002-TEST</property>
<property name="licenseTemplateNumbers">LT001-TEST,LT002-TEST</property>
</item>
</items>
</netlicensing>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<property name="description">Description 1</property>
<property name="price">10</property>
<property name="currency">EUR</property>
<property name="licenseTemplatesNumbers">LT001-TEST,LT002-TEST</property>
<property name="licenseTemplateNumbers">LT001-TEST,LT002-TEST</property>
</item>
<item type="Bundle">
<property name="number">B002-TEST</property>
Expand All @@ -19,7 +19,7 @@
<property name="description">Description 2</property>
<property name="price">20</property>
<property name="currency">USD</property>
<property name="licenseTemplatesNumbers">LT003-TEST,LT004-TEST</property>
<property name="licenseTemplateNumbers">LT003-TEST,LT004-TEST</property>
</item>
<item type="Bundle">
<property name="number">B003-TEST</property>
Expand All @@ -28,7 +28,7 @@
<property name="description">Description 3</property>
<property name="price">30</property>
<property name="currency">EUR</property>
<property name="licenseTemplatesNumbers">LT005-TEST,LT006-TEST</property>
<property name="licenseTemplateNumbers">LT005-TEST,LT006-TEST</property>
</item>
</items>
</netlicensing>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<property name="description">Description 2</property>
<property name="price">20.00</property>
<property name="currency">USD</property>
<property name="licenseTemplatesNumbers">LT003-TEST,LT004-TEST</property>
<property name="licenseTemplateNumbers">LT003-TEST,LT004-TEST</property>
</item>
</items>
</netlicensing>

0 comments on commit 3d3e789

Please sign in to comment.