From b0cf186f61c039a7d2768dd36125132ba576a029 Mon Sep 17 00:00:00 2001 From: andyjk15 Date: Wed, 5 Feb 2020 23:28:54 +0000 Subject: [PATCH] [05.02.20] Missed variable addition to graphQl Schema Mutation --- src/main/resources/application.properties | 20 ++++----- src/main/resources/graphql/configQL.graphqls | 2 +- .../BtcPriceRepositoryTest.groovy | 44 ------------------- 3 files changed, 11 insertions(+), 55 deletions(-) delete mode 100644 src/test/java/integration/pricing/models/repositories/BtcPriceRepositoryTest.groovy diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 855cb24..1f4a883 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,10 +1,10 @@ -server.port=9090 -spring.jpa.database=POSTGRESQL -spring.datasource.platform=postgres -spring.datasource.url=jdbc:postgresql://localhost:5432/postgres -spring.datasource.username=postgres -spring.datasource.password=***** -spring.jpa.show-sql=true -spring.jpa.generate-ddl=true -spring.jpa.hibernate.ddl-auto=create-drop -spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true \ No newline at end of file +#server.port=9090 +#spring.jpa.database=POSTGRESQL +#spring.datasource.platform=postgres +#spring.datasource.url=jdbc:postgresql://localhost:5432/postgres +#spring.datasource.username=postgres +#spring.datasource.password=***** +#spring.jpa.show-sql=true +#spring.jpa.generate-ddl=true +#spring.jpa.hibernate.ddl-auto=create-drop +#spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true \ No newline at end of file diff --git a/src/main/resources/graphql/configQL.graphqls b/src/main/resources/graphql/configQL.graphqls index c829a24..c372e21 100644 --- a/src/main/resources/graphql/configQL.graphqls +++ b/src/main/resources/graphql/configQL.graphqls @@ -35,7 +35,7 @@ type Query { } type Mutation { - createBtc(createdDate: String!, type: String!, average_price: Float!, high_price: Float, low_price: Float, close_price: Float, volume: Float):BtcPrice + createBtc(createdDate: String!, type: String!, average_price: Float!, high_price: Float, low_price: Float, open_price: Float, close_price: Float, volume: Float):BtcPrice createTweet(createdDate: String!, rawTweet: String!, sentimentScore: Float!, positiveScore: Float, neutralScore: Float, negativeScore: Float, compoundScore: Float!):tweetModel } \ No newline at end of file diff --git a/src/test/java/integration/pricing/models/repositories/BtcPriceRepositoryTest.groovy b/src/test/java/integration/pricing/models/repositories/BtcPriceRepositoryTest.groovy deleted file mode 100644 index e22e654..0000000 --- a/src/test/java/integration/pricing/models/repositories/BtcPriceRepositoryTest.groovy +++ /dev/null @@ -1,44 +0,0 @@ -package integration.pricing.models.repositories - -import cryptosky.me.graphql.pricing.models.entities.BtcPriceModel -import cryptosky.me.graphql.pricing.models.repositories.BtcPriceRepository -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest -import org.springframework.boot.test.context.SpringBootTest -import spock.lang.Specification - -@SpringBootTest -@DataJpaTest -class BtcPriceRepositoryTest extends Specification { - - @Autowired - BtcPriceRepository btcPriceRepository - - BtcPriceModel btcPriceModel - - def setup() { - btcPriceModel = new BtcPriceModel("", "", 23F, 23.2F, 22.91F, 23.01F, 245F) - } - - def "Data should be able to be saved to the repository if it required class variables"() { - - when: "Load BTC price entity" - -// btcPriceModel.setTimestamp("2020-02-03T15:00:00+00:00") -// btcPriceModel.setType("BTC-GBP") -// btcPriceModel.setAverage_price(23F) -// btcPriceModel.setHigh_price(23.12F) -// btcPriceModel.setLow_price(22.87F) -// btcPriceModel.setClose_price(23.1F) -// btcPriceModel.setVolume(345F) - - println(btcPriceModel) - - def entity = btcPriceRepository.save(btcPriceModel) - def result = btcPriceRepository.findOne(entity.getTimestamp()) - - then: "A single entry to exist in the repository" - btcPriceRepository.count() == 1L - entity.getTimestamp() == result.get().timestamp - } -}