integration-testing

Environment variables not set when running Java integration tests

本小妞迷上赌 提交于 2020-01-24 20:37:13
问题 When running our Java integration tests for a basic GET service, our application code cannot retrieve environment variables. However when we run the application itself it can retrieve the variables without issue. We are developing on a Mac (el captiain) with intellij as our IDE. We have exported the variables in our bash_profile (e.g. export ORACLE_URL="*************"). And we can echo the variable after setting and refreshing. We are completely stumped as to why they work during a gradlew

Rails Integration Testing - How to Simulate bad CSRF token and Expired Session

核能气质少年 提交于 2020-01-23 22:47:08
问题 I just changed exception handling code in my application_controller.rb to correctly capture ActionController::InvalidAuthenticityToken . I was previously doing a rescue_from Exception that was defined after the recuse_from ActionController::InvalidAuthenticityToken. This was taking priority and my intended rescue_from code was not being executed. I'd like to write an integration test to verify this behavior. How can I create an object that will allow me to send a bad CSRF token to a post

Spring Boot + Cloud | Zuul Proxy | Integration testing

大城市里の小女人 提交于 2020-01-22 17:54:47
问题 When working with Spring Boot to build micro-services its very easy to write extensive and very readable integration tests and mock remote service requests with MockRestServiceServer . Is there a way to use similar approach to perform additional integration test on ZuulProxy ? What I would like to achieve is being able to mock remote servers that ZuulProxy would forward to and validate that all of my ZuulFitler s behaved as expected. However, ZuulProxy is using RestClient from Netflix

Grails 2.0 integration test pollution?

假如想象 提交于 2020-01-21 07:36:26
问题 So i have a small integration test that houses 5 tests in total. Running that test exclusively results in all tests passed. However running my entire test suite results in 4 test failures of the 5. I've just recently upgraded to grails-2.0 from 1.3.7 and i switched from hsqldb to h2. Has anyone any pointers in which direction i should be looking in order to fix this (test-pollution) problem? Domain model Integration test: class SeriesIntegrationTests extends GrailsUnitTestCase { Series series

How do I log in a user with Devise for Rails controller/integration unit tests?

China☆狼群 提交于 2020-01-17 06:57:06
问题 All the other answers are wrong or out of date. I've tried several things. This is what I have: require 'test_helper' class DealsControllerTest < ActionDispatch::IntegrationTest include Devise::Test::IntegrationHelpers setup do @deal = deals(:one) @user = users(:one) # https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-(and-RSpec) #@request.env["devise.mapping"] = Devise.mappings[:one] #sign_in @user #log_in_as @user ApplicationController.allow_forgery

npm run custom-tests - sendHttpRequest failed non200Response

泄露秘密 提交于 2020-01-16 16:11:00
问题 I'm trying to setup some SailsJS boilerplate I'm finding on the web. My code is below, I am thinking it is due to my config in routes where I set: 'GET /.temporary/csrf/token/for/tests': { action: 'security/grant-csrf-token' } I don't have any thing in api/controllers/ for security/grant-csrf-token , do I have to generate such a thing? const sails = require('sails'); before(function(done) { // Increase the Mocha timeout so that Sails has enough time to lift, even if you have a bunch of assets

npm run custom-tests - sendHttpRequest failed non200Response

梦想的初衷 提交于 2020-01-16 16:08:25
问题 I'm trying to setup some SailsJS boilerplate I'm finding on the web. My code is below, I am thinking it is due to my config in routes where I set: 'GET /.temporary/csrf/token/for/tests': { action: 'security/grant-csrf-token' } I don't have any thing in api/controllers/ for security/grant-csrf-token , do I have to generate such a thing? const sails = require('sails'); before(function(done) { // Increase the Mocha timeout so that Sails has enough time to lift, even if you have a bunch of assets

Pointing HiveServer2 to MiniMRCluster for Hive Testing

拈花ヽ惹草 提交于 2020-01-15 11:26:08
问题 I've been wanting to do Hive integration testing for some of the code that I've been developing. The two major requirements of the testing framework that I need: It needs to work with a Cloudera version of Hive and Hadoop (preferably, 2.0.0-cdh4.7.0) It needs to be all local . Meaning, the Hadoop cluster and Hive server should start on the beginning of the test, run a few queries, and teardown after the test is over. So I broke this problem down into three parts: Getting code for the

cabybara-webkit + rspec: Records are not available

微笑、不失礼 提交于 2020-01-15 11:19:09
问题 I'm new to the integration testing, although I've done a lot of unit tests for my models and controllers. But now I want to test the whole stack. (I don't want to use Cucumber, since there is no customer and I can read code) Here my (simplified) spec describe ArticlesController, "#show" do before do @article = Factory :article, :title => "Lorem ipsum" end it "should show the article page" do visit article_path(:id => @article) page.should have_content("Lorem ipsum") end end The spec passes,

Create users in Factory Girl with OmniAuth?

空扰寡人 提交于 2020-01-14 10:16:17
问题 I am currently creating an application that uses OmniAuth to create and authenticate users. I am encountering problems during testing due to Factory Girl being unable to generate users without OmniAuth. I have several different ways to get factory girl to create users with omniauth but none have been successful. I have added the following 2 lines to my spec_helper file OmniAuth.config.test_mode = true \\ allows me to fake signins OmniAuth.config.add_mock(:twitter, { :uid => '12345', :info =>