DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

The Latest Testing, Tools, and Frameworks Topics

article thumbnail
Top 7 Programming Languages for Test Automation in 2020
In this article, look at a highlight of the top 7 programming languages to look out for for test automation in 2020.
March 5, 2020
by Himanshu Sheth DZone Core CORE
· 24,883 Views · 15 Likes
article thumbnail
Testing Asynchronous Operations in Spring With JUnit 5 and Byteman
In this article, we will be discussing how to test operations in an application that uses a Spring context (with asynchronous operations enabled).
February 28, 2020
by Szymon Tarnowski DZone Core CORE
· 39,695 Views · 7 Likes
article thumbnail
Authorizing the MuleSoft API Using AWS Cognito User Pool and Mule JWT Validation Policy
This article describes in-depth the process of using AWS Cognito and a Mule JWS validation policty to authorize the MuleSoft API.
Updated February 25, 2020
by Jitendra Bafna
· 26,840 Views · 5 Likes
article thumbnail
Top 6 Complete Automation Testing Solutions
These six solutions are some of the best for automation testing.
Updated February 21, 2020
by Rafaelo Condret
· 28,410 Views · 16 Likes
article thumbnail
Incorporating Fault-Tolerance Into Your Microservice Architecture
In this article, we discuss the process of incorporating fault-tolerance into a microservice architecture.
February 19, 2020
by Oresztesz Margaritisz DZone Core CORE
· 10,671 Views · 13 Likes
article thumbnail
Implementing DDoS With MuleSoft: Demonstration With Apache JMeter
In this article, we discuss how to stop DDoS attacks with MuleSoft by limiting the number of time a user can hit a certain API endpoint.
February 14, 2020
by Gaurav Dhimate
· 16,550 Views · 4 Likes
article thumbnail
Testing Asynchronous Operations in Spring With Spock and Byteman
In this article, we discuss how to test asynchronous operations in Spring applications with Spock and Byteman.
February 13, 2020
by Szymon Tarnowski DZone Core CORE
· 13,434 Views · 5 Likes
article thumbnail
Achieving SOC 2 Compliance in DevOps
Learn more about the specific guidelines for meeting SOC 2 security requirements in a DevOps pipeline and how AWS can help meet them.
February 10, 2020
by Mauricio Ashimine
· 27,721 Views · 3 Likes
article thumbnail
Implementing MUnit And MUnit Matchers With MuleSoft
MUnit is a Mule application testing framework that allows you to build automated tests for your Mule integrations and APIs.
Updated February 10, 2020
by Jitendra Bafna
· 24,308 Views · 4 Likes
article thumbnail
When to ''Unstub'' a Component in a Vue.js Unit Test
To test a component in isolation you can replace it's children components by stubbing them. Vue Test Utils can automatically do this for you with a feature called shallowMount. But what happens if a component is tightly coupled to one of its children? You can still use shallowMount, but you'll then have to selectively "unstub" the tightly coupled child. In this article, I'll show you how to use stubbing to write simpler unit tests. Note: this article was originally posted here on the Vue.js Developers blog on 2019/09/30. Testing in isolation A key idea of unit testing is to test a "unit" of the application in isolation. In component-based frontend apps, we consider the "unit" to be a component. Testing a component in isolation ensures that tests are unaffected by dependencies and other influences of children components. To isolate a component from surrounding components, you can stub it's children components. The diagram below shows how stubbing this way would affect a typical component hierarchy. Stubbing a component usually means replacing it with a simple "stand in" component with no state, logic, and a minimal template. For example, you might replace this: export default { name: "MyComponent", template: "..." props: { ... }, methods: { ... }, computed: { ... } ... }; with this: export default { name: "MyComponentStub" template: "" }; Rather than manually stubbing children components, though, Vue Test Utils offers the shallowMount feature which does it automatically. Coupled components In the real world, components aren't always completely decoupled. Sometimes a component relies on a child component and so the child can't be stubbed without losing some functionality. For example, say we make a button with a cool animation, and we want to reuse it across an app, and so we decide to create a custom component called animated-button. We now have the my-form component that uses this button component. It's been implemented such that my-form is coupled to animated-button, since the latter emits a "click" event that's used to trigger the submit method in the former. MyForm.vue Unit testing my-form Another key idea of unit testing is that we want to test the inputs and outputs of the unit and consider the internals to be a black box. In the my-form component, we should make a unit test where the input is the click of the button, while the output is the Vuex commit. We'll call this test "should commit FORM_SUBMIT when button clicked". We'll create it by first shallow mounting MyForm to isolate it from the influence of any children components as previously prescribed. MyForm.spec.js import { shallowMount } from "@vue/test-utils"; import MyForm from "@/components/MyForm"; describe("MyForm.vue", () => { it("should commit FORM_SUBMIT when button clicked", () => { const wrapper = shallowMount(MyForm); }); }); Next, we'll use the wrapper find API method to find the button component. We pass a CSS selector "animated-button" as the locator strategy. We can then chain the trigger method and pass "click" as the argument. This is how we generate the input of the test. We can then assert that a Vuex commit gets made (probably using a spy, but that's not relevant to this article so I won't detail it). MyForm.spec.js it("should commit FORM_SUBMIT when button clicked", () => { const wrapper = shallowMount(MyForm); wrapper.find("animated-button").trigger("click"); // assert that $store.commit was called }); If we try to run that, we'll get this error from Vue Test Utils: find did not return animated-button, cannot call trigger() on empty Wrapper Is the CSS selector wrong? No, the issue is that we shallow mounted the component, so all the children were stubbed. The auto-stub process changes the name of AnimatedButton to "animated-button-stub" in the template. But changing the selector from "animated-button" to "animated-button-stub" is not a solution. Auto-stubs have no internal logic, so the click event we trigger on it is not being listened to anyway. Selective unstubbing We still want to shallow mount my-form, as we want to ensure it's isolated from the influence of its children. But animated-button is an exception as it's functionality is required for the test. Vue Test Utils allows us to specify the stub for a particular component rather than using an auto-stub when shallow mounting. So the trick is to "unstub" animated-button by using its original component definition as the stub so it retains all of its functionality! To do this, let's import the AnimatedButton component at the top of the file. Now, let's go to our test and create a const stubs and assign it an object. We can put AnimatedButton as an object property shorthand. Now, we'll pass in stubs as part of our shallow mount config. We'll also replace the CSS selector with the component definition, as this is the preferred way of using the find method. MyForm.spec.js import { shallowMount } from "@vue/test-utils"; import MyForm from "@/components/MyForm"; import AnimatedButton from "@/component/AnimatedButton" describe("MyForm.vue", () => { it("should commit FORM_SUBMIT when button clicked", () => { const stubs = { AnimatedButton }; const wrapper = shallowMount(MyForm, { stubs }); wrapper.find(AnimatedButton).trigger("click"); ... }); }); Doing it this way should give you a green tick. Wrap up You always want to isolate your components in a unit test, which can easily be achieved by stubbing all the children components with shallowMount. However, if your component is tightly coupled with one of its children, you can selectively "unstub" that component by providing the component definition as a stub and overriding the auto-stub. Become a senior Vue developer in 2020. Learn and master what professionals know about building, testing, and deploying, full-stack Vue apps in our latest course. Learn more
February 7, 2020
by Anthony Gore
· 6,405 Views · 2 Likes
article thumbnail
Using AWS Step Functions For Offloading Exponential Backoffs
This tutorial demonstrates how you can apply AWS Step Functions to offload exponential backoffs as well as the technical challenges that entails.
Updated February 6, 2020
by Murat Balkan DZone Core CORE
· 9,152 Views · 2 Likes
article thumbnail
Top 21 Selenium Automation Testing Blogs to Look Out For!
In this article, we have a look at the top 21 Selenium testing blogs (in no particular order) that would be helpful in your testing expedition.
February 6, 2020
by Himanshu Sheth DZone Core CORE
· 27,268 Views · 15 Likes
article thumbnail
Penetration Test Types for (REST) API Security Tests
Penetration testing for REST API security provides a comprehensive testing method and is supported by a number of open source and proprietary tools.
February 5, 2020
by Hari Subramanian
· 20,764 Views · 4 Likes
article thumbnail
The Anatomy of a Microservice, Satisfying the Interface
This article builds upon the ideas of interface implementation with unit testing, client implementations, and beyond.
February 4, 2020
by Ray Elenteny DZone Core CORE
· 10,401 Views · 6 Likes
article thumbnail
7 Best Practices to Achieve Better Results in Quality Assurance
A well-planned and executed QA process not only assures the quality of the product but also the success of the product and business operations.
February 3, 2020
by Stella M
· 23,444 Views · 3 Likes
article thumbnail
Set Up a CI/CD Pipeline for An Angular 7 Application From Azure DevOps to AWS S3 - Part 2
The second part of this tutorial finishes the series by walking you through the rest of the process of setting up a CI/CD pipeline for an Angular app.
January 31, 2020
by Ishan Juneja
· 60,395 Views · 4 Likes
article thumbnail
Testing Spring Boot Apps With Kafka and Awaitility
Learn more about testing Spring Boot apps with Kafka and Awaitility!
Updated January 30, 2020
by Nakul Shukla
· 29,682 Views · 5 Likes
article thumbnail
The Anatomy of Good Unit Testing
Here is a collection of thoughts and tid-bits that the author finds useful when writing tests (with examples in C#).
Updated January 30, 2020
by Jason Fauchelle
· 20,388 Views · 7 Likes
article thumbnail
An Efficient Object Storage for JUnit Tests
There are several limitations to store and fetch such data —to resolve the problem it was suggested to find more suitable data storage.
January 29, 2020
by Aleksandr Kirilenko
· 14,799 Views · 3 Likes
article thumbnail
Oracle Data Integrator (ODI): Executing A Load Plan
This article explains how to create and execute a Load Plan in Oracle Data Integrator.
January 28, 2020
by Chetan Palwe
· 13,426 Views · 4 Likes
  • Previous
  • ...
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×