@Test public void shouldDoNothingWithNoStrategy() throws TokenStrategyFailedException { Token mockToken = mock(Token.class); TokenBlobStrategy strategy = new TokenBlobStrategy(factory, config); strategy.perfom(mockToken); verify(mockToken, times(0)).getBlob(); }
public void perfom(Token token) throws TokenStrategyFailedException { for (BlobStrategy strategy : strategies) { strategy.perform(token); } }
TokenBlobStrategy { public void perfom(Token token) throws TokenStrategyFailedException { for (BlobStrategy strategy : strategies) { strategy.perform(token); } } }
TokenBlobStrategy { public void perfom(Token token) throws TokenStrategyFailedException { for (BlobStrategy strategy : strategies) { strategy.perform(token); } } @Inject  TokenBlobStrategy(TokenStrategyFactory factory, CoreTokenConfig config); }
TokenBlobStrategy { public void perfom(Token token) throws TokenStrategyFailedException { for (BlobStrategy strategy : strategies) { strategy.perform(token); } } @Inject  TokenBlobStrategy(TokenStrategyFactory factory, CoreTokenConfig config); void perfom(Token token); void reverse(Token token); }
TokenBlobStrategy { public void perfom(Token token) throws TokenStrategyFailedException { for (BlobStrategy strategy : strategies) { strategy.perform(token); } } @Inject  TokenBlobStrategy(TokenStrategyFactory factory, CoreTokenConfig config); void perfom(Token token); void reverse(Token token);  }