Skip to content

Instantly share code, notes, and snippets.

View madan712's full-sized avatar

Madan Chaudhary madan712

View GitHub Profile
@madan712
madan712 / HelloWorldTest.java
Last active January 13, 2019 19:30
HelloWorldTest.java of Parameterized Junit Test example
package com.javaxp.parameterized_test_example;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
@madan712
madan712 / pom.xml
Created January 13, 2019 19:23
Hello World Parameterized Junit Test
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.javaxp</groupId>
<artifactId>parameterized-test-example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
@madan712
madan712 / hello-world.feature
Last active October 6, 2018 16:48
hello-world.feature - Java - Cucumber Hello World example
Feature: Cucumber hello world example
Scenario Outline: Hello World
Given A String name <name>
When sayHello method of HelloWorld.java is called
Then It should return <output>
Examples:
| name | output |
| World | Hello World |
@madan712
madan712 / console.log
Created October 6, 2018 15:52
console.log - Java - Cucumber Hello World example
Feature: Cucumber hello world example
HelloWorld - sayHello - name = World
Scenario: Hello World # hello-world.feature:3
Given A String name World # HelloWorldSteps.givenInput(String)
When sayHello method of HelloWorld.java is called # HelloWorldSteps.whenBusinessLogicCalled()
Then It should return Hello World # HelloWorldSteps.thenCheckOutput(String)
HelloWorld - sayHello - name = Java
Scenario: Hello Java # hello-world.feature:8
@madan712
madan712 / RunCucumberTest.java
Created October 6, 2018 15:33
RunCucumberTest.java - Java - Cucumber Hello World example
package com.javaxp;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(monochrome = true, features = "src/test/resources", plugin = { "pretty" })
public class RunCucumberTest {
@madan712
madan712 / HelloWorldSteps.java
Created October 6, 2018 15:16
HelloWorldSteps.java - Java - Cucumber Hello World example
package com.javaxp;
import org.junit.Assert;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class HelloWorldSteps {
private HelloWorld helloWorld = new HelloWorld();
@madan712
madan712 / hello-world.feature
Created October 6, 2018 15:10
hello-world.feature - Java - Cucumber Hello World example
Feature: Cucumber hello world example
Scenario: Hello World
Given A String name World
When sayHello method of HelloWorld.java is called
Then It should return Hello World
Scenario: Hello Java
Given A String name Java
When sayHello method of HelloWorld.java is called
@madan712
madan712 / pom.xml
Created October 6, 2018 15:09
pom.xml - Java - Cucumber Hello World example
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.javaxp</groupId>
<artifactId>CucumberHelloWorld</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>CucumberHelloWorld</name>
<url>http://maven.apache.org</url>
@madan712
madan712 / FileHandler.java
Created August 25, 2018 09:40
FileHandler.java for Simple spring integration with springboot
package com.javaxp;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.MessagingException;
@madan712
madan712 / FilePoller.java
Created August 25, 2018 09:39
FilePoller.java for Simple spring integration with springboot
package com.javaxp;
import java.io.File;
import org.springframework.integration.file.FileReadingMessageSource;
import org.springframework.integration.file.filters.FileListFilter;
public class FilePoller extends FileReadingMessageSource {
public FilePoller(File directory, FileListFilter<File> filter) {