Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am kasia-kittel on github.
  • I am kasiacp (https://keybase.io/kasiacp) on keybase.
  • I have a public key ASDtoxjZtebE-JQ0I3MSSWvKObgarbmc_Mi8knI_6HTRGwo

To claim this, I am signing this object:

@kasia-kittel
kasia-kittel / test
Last active September 16, 2019 13:13
(...)-MBP:aws kasia$ aws-vault exec test -- go test -v -timeout 15m -run TestIsPublicSubnet
=== RUN TestIsPublicSubnet
=== PAUSE TestIsPublicSubnet
=== CONT TestIsPublicSubnet
TestIsPublicSubnet 2019-09-16T14:12:24+01:00 region.go:91: Using region eu-west-3
--- PASS: TestIsPublicSubnet (3.17s)
PASS
ok terratest/modules/aws 3.199s
@kasia-kittel
kasia-kittel / tests.txt
Created September 2, 2019 13:17
Terratest PR tests output
(...):aws kasia$ aws-vault exec test -- go test -v -timeout 15m -run TestGetDefaultVpc
=== RUN TestGetDefaultVpc
=== PAUSE TestGetDefaultVpc
=== CONT TestGetDefaultVpc
TestGetDefaultVpc 2019-09-02T14:16:24+01:00 region.go:91: Using region us-east-1
--- PASS: TestGetDefaultVpc (1.38s)
PASS
ok terratest/modules/aws 1.410s
(...):aws kasia$ aws-vault exec test -- go test -v -timeout 15m -run TestGetVpcById
=== RUN TestGetVpcById
@kasia-kittel
kasia-kittel / Merging many Future[Seq].sc
Created August 5, 2016 08:58
Merging many Future[Seq] into one Future[Seq]
import scala.concurrent.ExecutionContext.Implicits.global
case class Error(name:String)
type Errors = Seq[Error]
trait getErrors {
def errors(): Future[Errors]
}
class Validation
object TypeValidation extends Validation with getErrors {

Scalatest matchers doesn't work with implicit conversion. Example:

"testing" when {

    implicit def stringToInt(s:String):Int = 123            //not used
    implicit def intToString(i:Int):String = "oneTwoThree"  //not used

 "implicit" should {
@kasia-kittel
kasia-kittel / Mockito stubbing with AnyVal
Last active November 22, 2018 11:36
Avoid NullPointerException when stubbing AnyVal using Mockito
you need to stub some opeation like:
when(formDAO.addFile(any[InputStream], eq(special.id))) thenReturn Right(FileId(1))
and:
case class SpecialId(id: Long) extends AnyVal {
override def toString: String = id.toString
}
since "AnyVal is the root class of all value types, which describe values not implemented as objects in the underlying host system."
and that confuses Mockito matchers...
@kasia-kittel
kasia-kittel / ISMS.md
Created March 31, 2016 10:21
Short information about Information Security Management Systems

Information Security Management System

Short definition

Systematic and structural approach / framework to manage sensitive information (i.e. customer data, financial information, intellectual property, employee details or information entrusted to them by third parties) so it reminds secure.

This is usually ensured by designing, implementing and maintaining a set of policies, processes and systems to manage risks related to all IT assets.

These policies, processes and systems should be applied to business, organisational and technical levels.

To assure ISMS accuracy it should be based on one of the information security standards like ISO27000:2005 or Common Criteria and shaped by the organisation's needs and objectives.