Skip to content

Instantly share code, notes, and snippets.

View gsumit1's full-sized avatar
🌺
Focusing

Sumit Ghosh gsumit1

🌺
Focusing
View GitHub Profile
@gsumit1
gsumit1 / stream.java
Created December 18, 2021 05:31
Example of Java Streams
package CollectionsManaging;
import java.util.ArrayList;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class stream {
public static void main(String[] arg){
ArrayList<Integer> a=new ArrayList<Integer>();
a.add(3);
a.add(4);
a.add(19);
@gsumit1
gsumit1 / CukesTest.java
Last active June 13, 2021 16:57
Use of the class GetTestStepName.java in the plugin.
package com.ctl.it.qa.sample.tests;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "src/test/resources/features/", plugin = { "pretty","com.ctl.it.qa.sample.tests.GetTestStepName" },tags = { "@Sample" })
public class CukesTest {
}
@gsumit1
gsumit1 / StepDefinition.java
Last active June 13, 2021 16:57
StepDefinition implements the various hooks to restricts the execution of scenarios which has failed steps along with custom exception message.
package com.ctl.it.qa.sample.tests;
import cucumber.api.Scenario;
import cucumber.api.java.After;
import cucumber.api.java.Before;
import net.serenitybdd.core.Serenity;
import net.thucydides.core.annotations.Steps;
import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.List;
@gsumit1
gsumit1 / GetTestStepName.java
Created June 13, 2021 16:12
GetTestStepName.java -this class provides you the currently executing step name.
package com.ctl.it.qa.sample.tests;
import cucumber.api.PickleStepTestStep;
import cucumber.api.event.ConcurrentEventListener;
import cucumber.api.event.EventHandler;
import cucumber.api.event.EventPublisher;
import cucumber.api.event.TestStepStarted;
public class GetTestStepName implements ConcurrentEventListener {
public static String currentStepName;
@gsumit1
gsumit1 / ResponseCreatedByMounteBank.js
Created August 22, 2020 19:20
ResponseCreatedByMounteBank-Proxy
{
"imposters": [
{
"predicates": [
{
"caseSensitive": true,
"deepEquals": {
"headers": {
"Host": "127.0.0.1:9907",
"Connection": "keep-alive",
@gsumit1
gsumit1 / SampleConfig.txt
Last active September 5, 2020 16:17
Simple Proxy
curl -i -X POST -H 'Content-Type: application/json' http://127.0.0.1:2525/imposters --data '{
"port":9907,
"protocol":"http",
"name":"proxyOnce",
"recordRequests": true,
"stubs":[
{
"responses":[
{
"proxy":{