Skip to content

Commit

Permalink
remove lcm
Browse files Browse the repository at this point in the history
  • Loading branch information
tharindu1st committed Mar 24, 2024
1 parent daf9b84 commit 1538e72
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 30 deletions.
2 changes: 1 addition & 1 deletion components/apimgt/org.wso2.carbon.apimgt.gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
--add-exports java.base/sun.nio.cs=ALL-UNNAMED
</argLine>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.wso2.org.ops4j.pax.logging:pax-logging-api</classpathDependencyExclude>
<classpathDependencyExclude>org.wso2.org.ops4j.pax.logging</classpathDependencyExclude>
<classpathDependencyExclude>org.wso2.orbit.com.fasterxml.jackson.core:jackson-core</classpathDependencyExclude>
</classpathDependencyExcludes>
<systemProperties>
Expand Down
11 changes: 1 addition & 10 deletions components/apimgt/org.wso2.carbon.apimgt.impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,7 @@
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.governance</groupId>
<artifactId>org.wso2.carbon.governance.custom.lifecycles.checklist</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.poi.wso2</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import org.wso2.carbon.apimgt.impl.importexport.ExportFormat;
import org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI;
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;
import org.wso2.carbon.apimgt.impl.lifecycle.CheckListItem;
import org.wso2.carbon.apimgt.impl.monetization.DefaultMonetizationImpl;
import org.wso2.carbon.apimgt.impl.notification.NotificationDTO;
import org.wso2.carbon.apimgt.impl.notification.NotificationExecutor;
Expand Down Expand Up @@ -96,7 +97,6 @@
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.databridge.commons.Event;
import org.wso2.carbon.governance.custom.lifecycles.checklist.util.CheckListItem;
import org.wso2.carbon.identity.application.common.model.IdentityProvider;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.api.UserStoreManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.apimgt.impl.lifecycle;
public class CheckListItem implements Comparable {
private String lifeCycleStatus;
private String name;
private String value;
private String order;
private String propertyName;
private String isVisible;
private static final Object HASH_CODE_OBJECT = new Object();

Check warning on line 26 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L26

Added line #L26 was not covered by tests

public String getVisible() {
return this.isVisible;

Check warning on line 29 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L29

Added line #L29 was not covered by tests
}

public void setVisible(String visible) {
this.isVisible = visible;
}

Check warning on line 34 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L33-L34

Added lines #L33 - L34 were not covered by tests

public String getPropertyName() {
return this.propertyName;

Check warning on line 37 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L37

Added line #L37 was not covered by tests
}

public void setPropertyName(String propertyName) {
this.propertyName = propertyName;
}

Check warning on line 42 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L41-L42

Added lines #L41 - L42 were not covered by tests

public String getLifeCycleStatus() {
return this.lifeCycleStatus;

Check warning on line 45 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L45

Added line #L45 was not covered by tests
}

public void setLifeCycleStatus(String lifeCycleStatus) {
this.lifeCycleStatus = lifeCycleStatus;
}

Check warning on line 50 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L49-L50

Added lines #L49 - L50 were not covered by tests

public String getName() {
return this.name;

Check warning on line 53 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L53

Added line #L53 was not covered by tests
}

public void setName(String name) {
this.name = name;
}

Check warning on line 58 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L57-L58

Added lines #L57 - L58 were not covered by tests

public String getValue() {
return this.value;

Check warning on line 61 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L61

Added line #L61 was not covered by tests
}

public void setValue(String value) {
this.value = value;
}

Check warning on line 66 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L65-L66

Added lines #L65 - L66 were not covered by tests

public String getOrder() {
return this.order;

Check warning on line 69 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L69

Added line #L69 was not covered by tests
}

public void setOrder(String order) {
this.order = order;
}

Check warning on line 74 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L73-L74

Added lines #L73 - L74 were not covered by tests

public CheckListItem(String lifeCycleStatus, String name, String value, String order) {
this.lifeCycleStatus = lifeCycleStatus;
this.name = name;
this.value = value;
this.order = order;
}

Check warning on line 81 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L76-L81

Added lines #L76 - L81 were not covered by tests

public CheckListItem() {
}

Check warning on line 84 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L83-L84

Added lines #L83 - L84 were not covered by tests

public boolean matchLifeCycleStatus(String status, boolean ignoreCase) {
if (this.lifeCycleStatus != null && status != null) {
return ignoreCase ? this.lifeCycleStatus.equalsIgnoreCase(status) : this.lifeCycleStatus.equals(status);
} else {
return false;

Check warning on line 90 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L90

Added line #L90 was not covered by tests
}
}

public boolean matchLifeCycleStatus(String status) {
return this.matchLifeCycleStatus(status, true);

Check warning on line 95 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L95

Added line #L95 was not covered by tests
}

public int hashCode() {
int hashCode = HASH_CODE_OBJECT.hashCode();

Check warning on line 99 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L99

Added line #L99 was not covered by tests
if (this.order != null) {
hashCode &= this.order.hashCode();

Check warning on line 101 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L101

Added line #L101 was not covered by tests
}

if (this.name != null) {
hashCode &= this.name.hashCode();

Check warning on line 105 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L105

Added line #L105 was not covered by tests
}

if (this.value != null) {
hashCode &= this.value.hashCode();

Check warning on line 109 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L109

Added line #L109 was not covered by tests
}

if (this.lifeCycleStatus != null) {
hashCode &= this.lifeCycleStatus.hashCode();

Check warning on line 113 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L113

Added line #L113 was not covered by tests
}

if (this.propertyName != null) {
hashCode &= this.propertyName.hashCode();

Check warning on line 117 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L117

Added line #L117 was not covered by tests
}

return hashCode;

Check warning on line 120 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L120

Added line #L120 was not covered by tests
}

public boolean equals(Object obj) {
if (!(obj instanceof CheckListItem)) {
return false;

Check warning on line 125 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L125

Added line #L125 was not covered by tests
} else {
CheckListItem item = (CheckListItem)obj;

Check warning on line 127 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L127

Added line #L127 was not covered by tests
return (this.order != null && this.order.equals(item.order) || this.order == null && item.order == null) && (this.lifeCycleStatus != null && this.lifeCycleStatus.equals(item.lifeCycleStatus) || this.lifeCycleStatus == null && item.lifeCycleStatus == null) && (this.name != null && this.name.equals(item.name) || this.name == null && item.name == null) && (this.value != null && this.value.equals(item.value) || this.value == null && item.value == null) && (this.propertyName != null && this.propertyName.equals(item.propertyName) || this.propertyName == null && item.propertyName == null);
}
}

public int compareTo(Object anotherItem) {
if (this.equals(anotherItem)) {
return 0;

Check warning on line 134 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L134

Added line #L134 was not covered by tests
} else {
CheckListItem item = (CheckListItem)anotherItem;
int otherItemOrder = Integer.parseInt(item.getOrder());
int itemOrder = Integer.parseInt(this.order);
return itemOrder - otherItemOrder;

Check warning on line 139 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/lifecycle/CheckListItem.java#L136-L139

Added lines #L136 - L139 were not covered by tests
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
import org.powermock.modules.junit4.PowerMockRunner;
Expand Down Expand Up @@ -105,7 +104,6 @@
import org.wso2.carbon.governance.api.generic.GenericArtifactManager;
import org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact;
import org.wso2.carbon.governance.api.util.GovernanceUtils;
import org.wso2.carbon.governance.custom.lifecycles.checklist.util.LifecycleBeanPopulator;
import org.wso2.carbon.registry.core.Collection;
import org.wso2.carbon.registry.core.Registry;
import org.wso2.carbon.registry.core.Resource;
Expand Down Expand Up @@ -152,7 +150,7 @@
@SuppressStaticInitializationFor("org.wso2.carbon.context.PrivilegedCarbonContext")
@PrepareForTest({ ServiceReferenceHolder.class, ApiMgtDAO.class, APIUtil.class, APIGatewayManager.class,
GovernanceUtils.class, PrivilegedCarbonContext.class, WorkflowExecutorFactory.class, JavaUtils.class,
APIProviderImpl.class, APIManagerFactory.class, RegistryUtils.class, LifecycleBeanPopulator.class,
APIProviderImpl.class, APIManagerFactory.class, RegistryUtils.class,
Caching.class, PaginationContext.class, MultitenantUtils.class, AbstractAPIManager.class, OASParserUtil.class,
KeyManagerHolder.class, CertificateManagerImpl.class , PublisherAPI.class, Organization.class,
APIPersistence.class, GatewayArtifactsMgtDAO.class, RegistryPersistenceUtil.class})
Expand Down Expand Up @@ -183,7 +181,6 @@ public void init() throws Exception {
PowerMockito.mockStatic(RegistryUtils.class);
PowerMockito.mockStatic(GovernanceUtils.class);
PowerMockito.mockStatic(WorkflowExecutorFactory.class);
PowerMockito.mockStatic(LifecycleBeanPopulator.class);
PowerMockito.mockStatic(KeyManagerHolder.class);
PowerMockito.mockStatic(Caching.class);
PowerMockito.mockStatic(PaginationContext.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.wso2.carbon.apimgt.impl.definitions.AsyncApiParser;
import org.wso2.carbon.apimgt.impl.definitions.OASParserUtil;
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;
import org.wso2.carbon.apimgt.impl.lifecycle.CheckListItem;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import org.wso2.carbon.apimgt.impl.wsdl.model.WSDLInfo;
import org.wso2.carbon.apimgt.impl.wsdl.model.WSDLValidationResponse;
Expand Down Expand Up @@ -121,7 +122,6 @@
import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WorkflowResponseDTO;
import org.wso2.carbon.core.util.CryptoException;
import org.wso2.carbon.core.util.CryptoUtil;
import org.wso2.carbon.governance.custom.lifecycles.checklist.util.CheckListItem;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
Expand Down
13 changes: 0 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -930,19 +930,6 @@
<version>${carbon.governance.version}</version>
</dependency>


<dependency>
<groupId>org.wso2.carbon.governance</groupId>
<artifactId>org.wso2.carbon.governance.custom.lifecycles.checklist</artifactId>
<version>${carbon.governance.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.poi.wso2</groupId>
<artifactId>poi-scratchpad</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.wso2.org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
Expand Down

0 comments on commit 1538e72

Please sign in to comment.