New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript tests fail on Gateway when generated from microservice app #7114

Closed
mraible opened this Issue Feb 12, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@mraible
Contributor

mraible commented Feb 12, 2018

Overview of the issue

I generated a gateway and a microservice app. Then I generated entities in the microservice app and on the gateway. When I try to build the gateway, tests fail.

[INFO] 12 02 2018 14:26:06.635:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
[INFO] 12 02 2018 14:26:06.637:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
[INFO] 12 02 2018 14:26:06.669:INFO [launcher]: Starting browser PhantomJS
[INFO] 12 02 2018 14:26:07.988:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket JQW7yGmhFCPFQEi0AAAA with id 93824405
        PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 17 of 44 SUCCESS (0 secs / 0.665 secs)
[INFO] .
[INFO] PhantomJS 2.1.1 (Mac OS X 0.0.0) Service Tests Blog Service Service methods should call correct URL FAILED
[INFO] 	Expected 'undefinedblog/api/blogs/123' to equal 'undefined/blog/api/blogs/123'.
[INFO] 	webpack:///src/test/javascript/spec/app/entities/blog/blog.service.spec.ts:38:48 <- spec/entry.ts:117278:48
Motivation for or Use Case

Tests should pass.

Reproduce the error

Create a gateway and an app. Run jhipster import-jdl on the following file in the app.

entity Blog {
    name String required minlength(3),
    handle String required minlength(2)
}

entity Entry {
    title String required,
    content TextBlob required,
    date ZonedDateTime required
}

entity Tag {
    name String required minlength(2)
}

relationship ManyToOne {
    Entry{blog(name)} to Blog
}

relationship ManyToMany {
    Entry{tag(name)} to Tag{entry}
}

In the gateway, run the following commands to generate the UI.

jhipster entity blog
jhipster entity entry
jhipster entity tag

jhipster info from gateway:

JHipster Version(s)
gateway@0.0.0 /Users/mraible/okta-jhipster-microservices-oauth-example/gateway
└── generator-jhipster@4.14.0

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.okta.developer.gateway",
      "nativeLanguage": "en",
      "microservicePath": "../store"
    },
    "jhipsterVersion": "4.14.0",
    "baseName": "gateway",
    "packageName": "com.okta.developer.gateway",
    "packageFolder": "com/okta/developer/gateway",
    "serverPort": "8080",
    "authenticationType": "oauth2",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "clientFramework": "angularX",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "gateway",
    "testFrameworks": [
      "protractor"
    ],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en"
    ]
  }
}

jhipster info from the microservice app:

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.okta.developer.blog",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "4.14.0",
    "baseName": "blog",
    "packageName": "com.okta.developer.blog",
    "packageFolder": "com/okta/developer/blog",
    "serverPort": "8081",
    "authenticationType": "oauth2",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "replaced-by-jhipster-info",
    "enableTranslation": true,
    "applicationType": "microservice",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "nativeLanguage": "en",
    "languages": [
      "en"
    ],
    "clientPackageManager": "yarn",
    "skipClient": true,
    "skipUserManagement": true
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Blog (blog) {
  name String required minlength(3),
  handle String required minlength(2)
}
entity Entry (entry) {
  title String required,
  content TextBlob required,
  date ZonedDateTime required
}
entity Tag (tag) {
  name String required minlength(2)
}

relationship ManyToOne {
  Entry{blog(name)} to Blog
}
relationship ManyToMany {
  Entry{tag(name)} to Tag{entry}
}

microservice Blog, Entry, Tag with blog

Environment and Tools

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

git version 2.14.1

node: v9.5.0

npm: 5.6.0

bower: 1.8.2

yeoman: 2.0.1

yarn: 1.3.2

Docker version 17.12.0-ce, build c97c6d6

docker-compose version 1.18.0, build 8dd22a9

  • Checking this box is mandatory (this is just to show you read everything)
@sendilkumarn

This comment has been minimized.

Contributor

sendilkumarn commented Feb 12, 2018

How did you generate the gateway with overriding spring-cloud-netflix?

@mraible

This comment has been minimized.

Contributor

mraible commented Feb 12, 2018

This happens when using the latest release 4.14.0, not the current master branch.

@deepu105

This comment has been minimized.

Member

deepu105 commented Feb 13, 2018

@deepu105

This comment has been minimized.

Member

deepu105 commented Feb 14, 2018

closing as its fixed in master. @mraible plz reopen if not

@deepu105 deepu105 closed this Feb 14, 2018

@jdubois jdubois added this to the 5.0.0-beta.0 milestone Apr 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment