Skip to content

Commit

Permalink
[RFR] Automate bug using custom rule with administracionEfectivo appl…
Browse files Browse the repository at this point in the history
…ication

Signed-off-by: Karishma Punwatkar <[email protected]>

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/custom-rules.test.ts
	new file:   cypress/fixtures/administracionEfectivo.ear
	modified:   cypress/fixtures/analysis.json
	new file:   cypress/fixtures/xml/test.windup.xml
  • Loading branch information
kpunwatk committed Mar 13, 2024
1 parent ef23d51 commit 20c74c3
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { deleteByList } from "../../../../../utils/utils";
import { CredentialsMaven } from "../../../../models/administration/credentials/credentialsMaven";
import { Application } from "../../../../models/migration/applicationinventory/application";

describe(["@tier2"], "Custom Rules in analyses", function () {
describe(["@tier2"], "Bug MTA-2015: Custom Rules in analyses", function () {
const applications: Analysis[] = [];
let sourceCredential: CredentialsSourceControlUsername;
let mavenCredential: CredentialsMaven;
Expand Down Expand Up @@ -95,6 +95,20 @@ describe(["@tier2"], "Custom Rules in analyses", function () {
exists("CUSTOM RULE FOR DEPENDENCIES");
});

// Automates Bug MTA-2015
it("Bug MTA-2015: Custom rule with administracionEfectivo application", function () {
const app = new Analysis(
getRandomApplicationData("customRule_administracionEfectivo"),
getRandomAnalysisData(this.analysisData["administracionEfectivo_custom_rules"])
);
applications.push(app);
app.create();
app.analyze();
app.verifyAnalysisStatus(AnalysisStatuses.completed);
Issues.openSingleApplication(app.name);
exists("CUSTOM RULE");
});

afterEach("Reset state", function () {
Application.open(true);
});
Expand Down
Binary file added cypress/fixtures/administracionEfectivo.ear
Binary file not shown.
8 changes: 8 additions & 0 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,5 +392,13 @@
"target": ["Containerization"],
"appName": "tackle testapp public jdk 9",
"openSourceLibraries": true
},

"administracionEfectivo_custom_rules": {
"appName": "administracionEfectivo-app custom rules",
"source": "Upload a local binary",
"target": ["Containerization"],
"binary": ["administracionEfectivo.ear"],
"customRule": "test.windup.xml"
}
}
37 changes: 37 additions & 0 deletions cypress/fixtures/xml/test.windup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<ruleset id="HZRules"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">

<metadata>
<description>
This ruleset detects embedded hazelcast, which may be problematic
when migrating an application to a cloud environment.
</description>
<dependencies>
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final"/>
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final"/>
</dependencies>

<targetTechnology id="cloud-readiness"/>

<tag>Hazelcast</tag>
</metadata>
<rules>
<rule id="Test-002-00001">
<when>
<file filename="AdministracionEfectivo-jpa{*}.jar"/>
</when>
<perform>
<hint title="Test-002 Remote Exception" effort="0" category-id="potential">
<message>
<![CDATA[ Test-002 Message markdown ]]>
</message>
<link href="http://nufc.com" title="Test-002 Test link">link</link>
</hint>
</perform>
</rule>
</rules>
</ruleset>

0 comments on commit 20c74c3

Please sign in to comment.