Skip to content

Instantly share code, notes, and snippets.

View safebear's full-sized avatar

Simon Stratton safebear

View GitHub Profile
@safebear
safebear / pom.xml
Created July 25, 2019 05:55
Cluecumber Report
<plugin>
<groupId>com.trivago.rta</groupId>
<artifactId>cluecumber-report-plugin</artifactId>
<version>1.8.0</version>
<executions>
<execution>
<id>report</id>
<phase>post-integration-test</phase>
<goals>
<goal>reporting</goal>
@safebear
safebear / ExcelUtils.java
Created July 17, 2019 06:06
Import Excel Spreadsheet - TestNG
public class ExcelUtils {
private static HSSFSheet ExcelWSheet;
private static HSSFWorkbook ExcelWBook;
private static HSSFCell Cell;
private static HSSFRow Row;
public static Object[][] getTableArray(String FilePath, String SheetName) throws Exception {
String[][] tabArray = null;
@safebear
safebear / azure-pipelines.yml
Created March 14, 2019 10:54
Filtering on Tests and Changing URL
# filtering on 'highPriority' but ignoring any test tagged as 'Ignore'
- task: VSTest@2
inputs:
testFiltercriteria: (TestCategory=highPriority&TestCategory!=Ignore)
# I.E. we add the 'testFiltercriteria' line to the 'inputs:' section of the Acceptance Tests
- task: VSBuild@1
@safebear
safebear / closures.js
Created March 8, 2019 11:10
Closures
function sayHi(greeting){
console.log(greeting)
}
sayHi("hello")
// 'greeting' variable contains the word 'Hello' when 'sayHi' is run
// but the 'greeting' variable no longer exists anywhere after 'sayHi' has finished executing
@safebear
safebear / callbacks.js
Created March 8, 2019 11:06
Callbacks, 'Then' and 'Async / Await'.
function first () {
console.log(1)
}
function second () {
console.log(2)
}
first();
second();
docker system prune --all --force --volumes
#! /bin/bash
set +e
sudo apt-get purge -y chromium-browser && \
sudo apt autoremove -y && \
sudo apt-get update && \
sudo apt-get install -y libappindicator1 fonts-liberation && \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
sudo dpkg -i google-chrome*.deb && \
sudo apt-get install -f -y && \
package com.safebear.tasklist.controller;
import com.safebear.tasklist.service.TaskService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
package com.safebear.tasklist.model;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.junit4.SpringRunner;
import java.time.LocalDate;
@safebear
safebear / TaskRepositoryTest.java
Last active July 11, 2018 13:58
Task Repository Test
package com.safebear.tasklist.repository;
import com.safebear.tasklist.model.Task;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.test.context.junit4.SpringRunner;