This file contains hidden or 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 void showFoo(Foo foo) { Foo foo2 = new Foo(); | |
//lot of code | |
if(foo.equals(foo2)) { | |
System.out.println("Two Men"); | |
} else { | |
System.out.println("And a Half"); | |
} | |
} |
This file contains hidden or 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 void showFoo(Foo foo) { | |
Foo foo2 = new Foo(); | |
//lot of code | |
if(Objects.equals(foo,foo2)) { | |
System.out.println("Two Men"); | |
} else { | |
System.out.println("And a Half"); |
This file contains hidden or 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
@Override public int hashCode() { | |
return Objects.hash(name, age, job); | |
} |
This file contains hidden or 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 void showFoo(Foo foo) { | |
this.bar = Objects.requireNonNull(foo); | |
} |
This file contains hidden or 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
String log = null; | |
if(foo == null) { | |
log = "Foo is Empty"; | |
} else { | |
log = foo.toString(); | |
} | |
logger.info(log); |
This file contains hidden or 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
logger.info(Objects.toString(foo, “Foo is Empty”)); |
This file contains hidden or 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 NightVoter implements AccessDecisionVoter { | |
private String rolePrefix = "ROLE_"; | |
private static final int SUNRISE_HOUR = 9; | |
private static final int SUNSET_HOUR = 21; | |
public String getRolePrefix() { | |
return rolePrefix; | |
} |
This file contains hidden or 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
<security:http auto-config="true" access-decision-manager-ref="accessDecision"> | |
<security:intercept-url pattern="/**" access="ROLE_USER"/> | |
</security:http> | |
<bean id="accessDecision" class="org.springframework.security.access.vote.AffirmativeBased"> | |
<property name="decisionVoters"> | |
<set> | |
<bean class="org.springframework.security.access.vote.RoleVoter"></bean> | |
<bean class="org.example.security.voter.NightVoter"></bean> | |
</set> |
This file contains hidden or 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
Scenario: trader should be not alerted below threshold and should be alerted above threshold | |
Given a stock of symbol <symbol> and a threshold of <threshold> | |
When the stock is traded at <price> | |
Then the alert status should be <status> | |
Examples: | |
|symbol|threshold|price|status| | |
|STK1|5|4|OFF| | |
|STK1|5|14|ON| |
This file contains hidden or 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
@Target(value=ElementType.TYPE) | |
@Retention(value=RetentionPolicy.RUNTIME) | |
@Documented | |
@Component | |
public @interface Steps { | |
} |
OlderNewer