[05.02.20] Missed variable addition to graphQl Schema Mutation

This commit is contained in:
andyjk15 2020-02-05 23:28:54 +00:00
parent ce14d59ca1
commit b0cf186f61
3 changed files with 11 additions and 55 deletions

View File

@ -1,10 +1,10 @@
server.port=9090 #server.port=9090
spring.jpa.database=POSTGRESQL #spring.jpa.database=POSTGRESQL
spring.datasource.platform=postgres #spring.datasource.platform=postgres
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres #spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=postgres #spring.datasource.username=postgres
spring.datasource.password=***** #spring.datasource.password=*****
spring.jpa.show-sql=true #spring.jpa.show-sql=true
spring.jpa.generate-ddl=true #spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create-drop #spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true #spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true

View File

@ -35,7 +35,7 @@ type Query {
} }
type Mutation { 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 createTweet(createdDate: String!, rawTweet: String!, sentimentScore: Float!, positiveScore: Float, neutralScore: Float, negativeScore: Float, compoundScore: Float!):tweetModel
} }

View File

@ -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
}
}