ibm-cloud-architecture / refarch-cloudnative-wfd-ui

A microservices sample application component, displaying a simple UI from a backend service call
0 stars 8 forks source link

build fails because tests fail #7

Closed jesusmah closed 7 years ago

jesusmah commented 7 years ago

Tests fail because of the testing assertion not being correct. The code looks for an index.html which generates the following tag:

<h1>Welcome to your Liberty Application</h1>

However, as you can see in the following output, index.html does not contain such tag.

 T E S T S
-------------------------------------------------------
Running it.HealthEndpointIT
Testing endpoint http://localhost:9089/WfdFrontEnd/rest/health
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.996 sec - in it.HealthEndpointIT
Running it.TestApplication
Testing http://localhost:9089/WfdFrontEnd/index.html
Testing http://localhost:9089/WfdFrontEnd/index.html
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec <<< FAILURE! - in it.TestApplication
testDeployment(it.TestApplication)  Time elapsed: 0.022 sec  <<< FAILURE!
java.lang.AssertionError: Incorrect response, response is <!doctype html><html lang="en"><head><meta charset="utf-8"><title>TryUI</title><base href="/WfdFrontEnd/"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico"><link href="styles.d41d8cd98f00b204e980.bundle.css" rel="stylesheet"/></head><body><app-root></app-root><script type="text/javascript" src="inline.3b80a577c81cd4c09ef9.bundle.js"></script><script type="text/javascript" src="polyfills.d8d3d78a4deb2ab66856.bundle.js"></script><script type="text/javascript" src="vendor.116261f15011a98a5ba2.bundle.js"></script><script type="text/javascript" src="main.f4e4a359fabf914cefc7.bundle.js"></script></body></html>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.assertTrue(Assert.java:41)
    at it.EndpointTest.testEndpoint(EndpointTest.java:25)
    at it.TestApplication.testDeployment(TestApplication.java:9)

Results :

Failed tests: 
  TestApplication.testDeployment:9->EndpointTest.testEndpoint:25 Incorrect response, response is <!doctype html><html lang="en"><head><meta charset="utf-8"><title>TryUI</title><base href="/WfdFrontEnd/"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico"><link href="styles.d41d8cd98f00b204e980.bundle.css" rel="stylesheet"/></head><body><app-root></app-root><script type="text/javascript" src="inline.3b80a577c81cd4c09ef9.bundle.js"></script><script type="text/javascript" src="polyfills.d8d3d78a4deb2ab66856.bundle.js"></script><script type="text/javascript" src="vendor.116261f15011a98a5ba2.bundle.js"></script><script type="text/javascript" src="main.f4e4a359fabf914cefc7.bundle.js"></script></body></html>

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0

I would recommend updating the tests to look for a different tag(s). For example:

<title>TryUI</title>

Hemankita commented 7 years ago

Modified the tests. "mvn install" is running fine now. Thank you.