test_class.declarator: transactionsService = mock(TransactionsService.class)
test_class.modifier: private final
test_class.original_string: private final TransactionsService transactionsService = mock(TransactionsService.class);
test_class.type: TransactionsService
test_class.var_name: transactionsService
test_class.declarator: webService = new TransactionsWebService(transactionsService)
test_class.modifier: private final
test_class.original_string: private final TransactionsWebService webService = new TransactionsWebService(transactionsService);
test_class.type: TransactionsWebService
test_class.var_name: webService
test_class.declarator: transaction1 = MockTransaction.create("2015-01-01", "abc", 123)
test_class.modifier: private final
test_class.original_string: private final Transaction transaction1 = MockTransaction.create("2015-01-01", "abc", 123);
test_class.type: Transaction
test_class.var_name: transaction1
test_class.declarator: transaction2 = MockTransaction.create("2015-01-02", "abc", 456)
test_class.modifier: private final
test_class.original_string: private final Transaction transaction2 = MockTransaction.create("2015-01-02", "abc", 456);
test_class.type: Transaction
test_class.var_name: transaction2
test_class.declarator: transactions = new Transactions(transaction1, transaction2)
test_class.modifier: private final
test_class.original_string: private final Transactions transactions = new Transactions(transaction1, transaction2);
test_class.type: Transactions
test_class.var_name: transactions
test_class.file: services/src/test/java/com/greensopinion/finance/services/web/TransactionsWebServiceTest.java
test_class.identifier: TransactionsWebServiceTest
test_case.body: @Test
  	public void putCategory() {
  		webService.putCategory(transaction1.getId(), new CategoryModel("a category"));
  
  		ArgumentCaptor<Transactions> transactionsCaptor = ArgumentCaptor.forClass(Transactions.class);
  		verify(transactionsService).update(transactionsCaptor.capture());
  		Transactions updated = transactionsCaptor.getValue();
  
  		Transaction transaction = updated.getTransactions().get(0);
  		assertEquals(transaction1, transaction);
  		assertEquals(transaction1.getId(), transaction.getId());
  		assertEquals("a category", transaction.getCategoryName());
  	}
test_case.class_method_signature: TransactionsWebServiceTest.putCategory()
test_case.full_signature: @Test public void putCategory()
test_case.identifier: putCategory
test_case.invocations: putCategory getId forClass update verify capture getValue get getTransactions assertEquals assertEquals getId getId assertEquals getCategoryName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void putCategory()
focal_class.declarator: BASE_PATH = "/transactions"
focal_class.modifier: static final
focal_class.original_string: static final String BASE_PATH = "/transactions";
focal_class.type: String
focal_class.var_name: BASE_PATH
focal_class.declarator: transactionsService
focal_class.modifier: private final
focal_class.original_string: private final TransactionsService transactionsService;
focal_class.type: TransactionsService
focal_class.var_name: transactionsService
focal_class.file: services/src/main/java/com/greensopinion/finance/services/web/TransactionsWebService.java
focal_class.identifier: TransactionsWebService
focal_class.class_method_signature: TransactionsWebService.TransactionsWebService(TransactionsService transactionsService)
focal_class.full_signature: @Inject  TransactionsWebService(TransactionsService transactionsService)
focal_class.identifier: TransactionsWebService
focal_class.modifiers: @Inject
focal_class.parameters: (TransactionsService transactionsService)
focal_class.signature:  TransactionsWebService(TransactionsService transactionsService)
focal_class.class_method_signature: TransactionsWebService.putCategory(@PathParam("transactionId") String transactionId, CategoryModel category)
focal_class.full_signature: @PUT @Path("{transactionId}/category") public void putCategory(@PathParam("transactionId") String transactionId, CategoryModel category)
focal_class.identifier: putCategory
focal_class.modifiers: @PUT @Path("{transactionId}/category") public
focal_class.parameters: (@PathParam("transactionId") String transactionId, CategoryModel category)
focal_class.return: void
focal_class.signature: void putCategory(@PathParam("transactionId") String transactionId, CategoryModel category)
focal_method.body: @PUT
  	@Path("{transactionId}/category")
  	public void putCategory(@PathParam("transactionId") String transactionId, CategoryModel category) {
  		validateRequired(transactionId, "Transaction id");
  		validateNotNull(category, "Category must be provided.");
  		validateRequired(category.getName(), "Category name");
  
  		Transactions transactions = transactionsService.retrieve();
  		Transaction transaction = transactions.byId(transactionId);
  		validate(transaction != null, format("Transaction with id \"{0}\" not found.", transactionId));
  
  		Transaction categorized = transaction.withCategoryName(category.getName());
  
  		transactionsService.update(transactions.copyWithReplacement(categorized));
  	}
focal_method.class_method_signature: TransactionsWebService.putCategory(@PathParam("transactionId") String transactionId, CategoryModel category)
focal_method.full_signature: @PUT @Path("{transactionId}/category") public void putCategory(@PathParam("transactionId") String transactionId, CategoryModel category)
focal_method.identifier: putCategory
focal_method.invocations: validateRequired validateNotNull validateRequired getName retrieve byId validate format withCategoryName getName update copyWithReplacement
focal_method.modifiers: @PUT @Path("{transactionId}/category") public
focal_method.parameters: (@PathParam("transactionId") String transactionId, CategoryModel category)
focal_method.return: void
focal_method.signature: void putCategory(@PathParam("transactionId") String transactionId, CategoryModel category)