@Test
public void showProject_shouldReturnAccessDenied_forUnauthenticatedUser() {
// Given an unauthenticated get project request
HttpEntity request = unauthenticatedRequest("GET /projects/1");
// When the request is handled by the application
ResponseEntity<ErrorResponse> response = handleRequest(request);
// Then a forbidden response should be returned
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-----------------------------------------------------------*/ | |
/*--- A block-sorting, lossless compressor bzip.c ---*/ | |
/*-----------------------------------------------------------*/ | |
/*-- | |
This program is BZIP, a lossless, block-sorting data compressor, | |
version 0.21, dated 25-August-1996. | |
Copyright (C) 1996 by Julian Seward. | |
Department of Computer Science, University of Manchester, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<xs:schema xmlns="http://example.com" | |
xmlns:mstns="http://example.com" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" | |
targetNamespace="http://example.com" | |
elementFormDefault="qualified" id="Example"> | |
<xs:element name="Example_Parent"> | |
<xs:complexType> | |
<xs:choice> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LinkShortnerTransformer extends AbstractSAXPipe implements Transformer { | |
private static final Logger log = LoggerFactory.getLogger(SitesmartRewriterTransformer.class); | |
private SlingHttpServletRequest httpRequest; | |
private static final String ATT_NAME = "href"; | |
private static final String EL_NAME = "a"; | |
public SitesmartRewriterTransformer() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"UserData": { | |
"Fn::Base64": { "Fn::Join":["", [ | |
"#!/bin/bash -ex\n", | |
"apt-get update\n", | |
"apt-get -y install python-setuptools\n", | |
"mkdir aws-cfn-bootstrap-latest\n", | |
"curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1\n", | |
"easy_install aws-cfn-bootstrap-latest\n", | |
"/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource WebServer", " --region ", { "Ref": "AWS::Region" }, "\n", | |
"\n", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Data | |
@Component | |
@ConfigurationProperties(prefix = "sample") | |
@Validated | |
public class SampleProperties { | |
@NotNull | |
private String sample1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.handler = function (event, context, callback) { | |
let body = ` | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Serverless Home</title> | |
<style> | |
.hidden { |